def test_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_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 )
test tcp/udp network port .