def test_url():
 schema = vol.Schema(cv.url)
 for value in ('invalid', None, 100, 'htp://ha.io', 'http//ha.io', 'http://??,**', 'https://??,**'):
  with pytest.raises(vol.MultipleInvalid):
   schema(value)
 for value in ('http://localhost', 'https://localhost/test/index.html', 'http://home-assistant.io', 'http://home-assistant.io/test/', 'https://community.home-assistant.io/'):
  assert schema(value)

def test_url ( ) : schema = vol . Schema ( cv . url ) for value in ( 'invalid' , None , 100 , 'htp://ha.io' , 'http//ha.io' , 'http://??,**' , 'https://??,**' ) : with pytest . raises ( vol . MultipleInvalid ) : schema ( value ) for value in ( 'http://localhost' , 'https://localhost/test/index.html' , 'http://home-assistant.io' , 'http://home-assistant.io/test/' , 'https://community.home-assistant.io/' ) : assert schema ( value )
test url .