Example #1
0
 def test_bad_url(self, url):
     with pytest.raises(ValueError) as cm:
         inputs.url(url)
     assert text_type(cm.value).startswith(
         '{0} is not a valid URL'.format(url))
Example #2
0
 def test_bad_url_with_suggestion(self, url):
     with pytest.raises(ValueError) as cm:
         inputs.url(url)
     assert text_type(
         cm.value
     ) == '{0} is not a valid URL. Did you mean: http://{0}'.format(url)
Example #3
0
 def test_valid_url(self, url):
     assert inputs.url(url) == url