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))
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)
def test_valid_url(self, url): assert inputs.url(url) == url