aboutsummaryrefslogtreecommitdiffstats
path: root/test/triple_store/sparql/test_sparql.py
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2023-03-02 15:29:12 +0100
committerMatthias Baumgartner <dev@igsor.net>2023-03-02 15:29:12 +0100
commitb66ed641d5cbb4cb83f4a571223e4d65d80ed05c (patch)
treecf52e778f611e7520bd92b99df22b6bf69e552ec /test/triple_store/sparql/test_sparql.py
parent2e07f33314c238e42bfadc5f39805f93ffbc622e (diff)
downloadbsfs-b66ed641d5cbb4cb83f4a571223e4d65d80ed05c.tar.gz
bsfs-b66ed641d5cbb4cb83f4a571223e4d65d80ed05c.tar.bz2
bsfs-b66ed641d5cbb4cb83f4a571223e4d65d80ed05c.zip
check non-serializable URIs in the sparql store
Diffstat (limited to 'test/triple_store/sparql/test_sparql.py')
-rw-r--r--test/triple_store/sparql/test_sparql.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/triple_store/sparql/test_sparql.py b/test/triple_store/sparql/test_sparql.py
index b1d99ac..d880082 100644
--- a/test/triple_store/sparql/test_sparql.py
+++ b/test/triple_store/sparql/test_sparql.py
@@ -678,6 +678,9 @@ class TestSparqlStore(unittest.TestCase):
self.assertRaises(errors.ConsistencyError, store.create, self.schema.node(ns.bsfs.Entity).child(ns.bsfs.invalid), {
URI('http://example.com/me/entity#1234'), URI('http://example.com/me/entity#4321')})
+ # guid must be valid
+ self.assertRaises(ValueError, store.create, self.schema.node(ns.bsfs.Entity), {URI('http://example.com/me/foo and bar')})
+
# can create some nodes
ent_type = store.schema.node(ns.bsfs.Entity)
store.create(ent_type, {URI('http://example.com/me/entity#1234'), URI('http://example.com/me/entity#4321')})
@@ -766,6 +769,9 @@ class TestSparqlStore(unittest.TestCase):
# invalid predicate is not permitted
self.assertRaises(errors.ConsistencyError, store.set, ent_type, ent_ids, p_invalid, {'http://example.com/me/tag#1234'})
+ # invalid guid is not permitted
+ self.assertRaises(ValueError, store.set, ent_type, {URI('http://example.com/me/foo and bar')}, p_filesize, {1234})
+
# predicate must match node_type
self.assertRaises(errors.ConsistencyError, store.set, tag_type, tag_ids, p_filesize, {1234})