add tcp/udp port to config validation (#2854)
This commit is contained in:
parent
781fe9c54e
commit
4fcfffc172
6 changed files with 26 additions and 20 deletions
|
@ -47,6 +47,18 @@ def test_longitude():
|
|||
schema(value)
|
||||
|
||||
|
||||
def test_port():
|
||||
"""Test tcp/udp network port."""
|
||||
schema = vol.Schema(cv.port)
|
||||
|
||||
for value in('invalid', None, -1, 0, 80000, '81000'):
|
||||
with pytest.raises(vol.MultipleInvalid):
|
||||
schema(value)
|
||||
|
||||
for value in ('1000', 21, 24574):
|
||||
schema(value)
|
||||
|
||||
|
||||
def test_platform_config():
|
||||
"""Test platform config validation."""
|
||||
for value in (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue