Skip to content

Commit

Permalink
tests(uri-validator): add additional tests
Browse files Browse the repository at this point in the history
Adding all URIs shown in the URI Wikipedia page [1] to the tests.

[1]: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Example_URIs

Signed-off-by: Silvano Cirujano Cuesta <[email protected]>
  • Loading branch information
Silvanoc committed Oct 13, 2023
1 parent fad9cd4 commit 9e268e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_utils/test_metamodelcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ def test_uri(self):
x = URI("rdf:type")
self.assertTrue(URI.is_valid(x))
self.assertTrue(URI.is_valid("urn:abc:123"))
self.assertTrue(URI.is_valid("https://[email protected]:123/forum/questions/?tag=networking&order=newest#top"))
self.assertTrue(URI.is_valid("ldap://[2001:db8::7]/c=GB?objectClass?one"))
self.assertTrue(URI.is_valid("ldap://[2001:db8::7]/c=GB?objectClass?one"))
self.assertTrue(URI.is_valid("mailto:[email protected]"))
self.assertTrue(URI.is_valid("news:comp.infosystems.www.servers.unix"))
self.assertTrue(URI.is_valid("tel:+1-816-555-1212"))
self.assertTrue(URI.is_valid("telnet://192.0.2.16:80/"))
self.assertTrue(URI.is_valid("urn:oasis:names:specification:docbook:dtd:xml:4.1.2"))
self.assertTrue(URI.is_valid("file:///home/user/"))

def test_bool(self):
self.assertTrue(Bool(True))
Expand Down

0 comments on commit 9e268e5

Please sign in to comment.