summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfredrik-aschehoug <15358786+fredrik-aschehoug@users.noreply.github.com>2021-03-14 17:51:34 +0100
committerfredrik-aschehoug <15358786+fredrik-aschehoug@users.noreply.github.com>2021-03-14 17:51:34 +0100
commitc03b01792d60ff442755984c15ed655117049107 (patch)
tree490869d99b43bc197d7568beb9df9770541af06c
parentda6402e12a267d3e54a344ec7fbeb9f6bc8497eb (diff)
downloadrdflib-c03b01792d60ff442755984c15ed655117049107.tar.gz
Add compute_qname test
-rw-r--r--test/test_namespace.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_namespace.py b/test/test_namespace.py
index 5c73d223..e3be3a1c 100644
--- a/test/test_namespace.py
+++ b/test/test_namespace.py
@@ -31,16 +31,24 @@ class NamespacePrefixTest(unittest.TestCase):
g.compute_qname(URIRef("http://foo/bar/")),
("ns1", URIRef("http://foo/bar/"), ""),
)
+
# should compute qnames of URNs correctly as well
self.assertEqual(
g.compute_qname(URIRef("urn:ISSN:0167-6423")),
("ns5", URIRef("urn:ISSN:"), "0167-6423"),
)
+
self.assertEqual(
g.compute_qname(URIRef("urn:ISSN:")),
("ns5", URIRef("urn:ISSN:"), ""),
)
+ # should compute qnames with parantheses correctly
+ self.assertEqual(
+ g.compute_qname(URIRef("http://foo/bar/name_with_(parantheses)")),
+ ("ns1", URIRef("http://foo/bar/"), "name_with_(parantheses)"),
+ )
+
def test_reset(self):
data = (
"@prefix a: <http://example.org/a> .\n"