コード例 #1
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)
コード例 #2
0
 def test_valid_url(self, url):
     assert inputs.url(url) == url
コード例 #3
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))
コード例 #4
0
ファイル: test_inputs.py プロジェクト: Dlotan/flask-restplus
 def assert_bad_url(self, value):
     with assert_raises(ValueError) as cm:
         inputs.url(value)
     assert_equal(text_type(cm.exception), '{0} is not a valid URL'.format(value))
コード例 #5
0
ファイル: test_inputs.py プロジェクト: Dlotan/flask-restplus
 def assert_bad_url_with_suggestion(self, value):
     with assert_raises(ValueError) as cm:
         inputs.url(value)
     assert_equal(text_type(cm.exception),
                  '{0} is not a valid URL. Did you mean: http://{0}'.format(value))
コード例 #6
0
 def assert_bad_url_with_suggestion(self, value):
     with assert_raises(ValueError) as cm:
         inputs.url(value)
     assert_equal(
         text_type(cm.exception),
         '{0} is not a valid URL. Did you mean: http://{0}'.format(value))
コード例 #7
0
 def assert_bad_url(self, value):
     with assert_raises(ValueError) as cm:
         inputs.url(value)
     assert_equal(text_type(cm.exception),
                  '{0} is not a valid URL'.format(value))
コード例 #8
0
ファイル: test_inputs.py プロジェクト: ziirish/flask-restplus
 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)
コード例 #9
0
ファイル: test_inputs.py プロジェクト: ziirish/flask-restplus
 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))
コード例 #10
0
ファイル: test_inputs.py プロジェクト: ziirish/flask-restplus
 def test_valid_url(self, url):
     assert inputs.url(url) == url