Skip to content

Commit

Permalink
Update tests for url validator
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalresistor committed Feb 1, 2019
1 parent ddd98c0 commit 7ccafc2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions colander/tests/test_colander.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,24 @@ def test_website_no_scheme(self):
result = self._callFUT(val)
self.assertEqual(result, None)

def test_ipv6(self):
val = "http://[2001:db8::0]/"

result = self._callFUT(val)
self.assertEqual(result, None)

def test_ipv4(self):
val = "http://192.0.2.1/"

result = self._callFUT(val)
self.assertEqual(result, None)

def test_file_raises(self):
from colander import Invalid

val = "file:///this/is/a/file.jpg"

self.assertRaises(Invalid, self._callFUT, val)

class TestUUID(unittest.TestCase):
def _callFUT(self, val):
Expand Down

0 comments on commit 7ccafc2

Please sign in to comment.