Skip to content

Commit 9e268e5

Browse files
committed
tests(uri-validator): add additional tests
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 <silvano.cirujano-cuesta@siemens.com>
1 parent fad9cd4 commit 9e268e5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_utils/test_metamodelcore.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ def test_uri(self):
9696
x = URI("rdf:type")
9797
self.assertTrue(URI.is_valid(x))
9898
self.assertTrue(URI.is_valid("urn:abc:123"))
99+
self.assertTrue(URI.is_valid("https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top"))
100+
self.assertTrue(URI.is_valid("ldap://[2001:db8::7]/c=GB?objectClass?one"))
101+
self.assertTrue(URI.is_valid("ldap://[2001:db8::7]/c=GB?objectClass?one"))
102+
self.assertTrue(URI.is_valid("mailto:John.Doe@example.com"))
103+
self.assertTrue(URI.is_valid("news:comp.infosystems.www.servers.unix"))
104+
self.assertTrue(URI.is_valid("tel:+1-816-555-1212"))
105+
self.assertTrue(URI.is_valid("telnet://192.0.2.16:80/"))
106+
self.assertTrue(URI.is_valid("urn:oasis:names:specification:docbook:dtd:xml:4.1.2"))
107+
self.assertTrue(URI.is_valid("file:///home/user/"))
99108

100109
def test_bool(self):
101110
self.assertTrue(Bool(True))

0 commit comments

Comments
 (0)