diff options
-rw-r--r-- | bsfs/graph/result.py | 5 | ||||
-rw-r--r-- | test/graph/test_nodes.py | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/bsfs/graph/result.py b/bsfs/graph/result.py index 3009801..688929b 100644 --- a/bsfs/graph/result.py +++ b/bsfs/graph/result.py @@ -20,6 +20,11 @@ __all__: typing.Sequence[str] = ( ## code ## +# FIXME: node, path, value seem counter-intuitive: +# node.get(..., node=True) removes the node part. +# wouldn't it make more sense if node=True keeps the node part +# and node=False drops it? + def to_list_view( triples, # aggregators diff --git a/test/graph/test_nodes.py b/test/graph/test_nodes.py index 670df69..4eae250 100644 --- a/test/graph/test_nodes.py +++ b/test/graph/test_nodes.py @@ -381,7 +381,7 @@ class TestNodes(unittest.TestCase): (self.p_author.uri, Nodes(self.backend, self.user, self.user_type, {URI('http://example.com/me/user#1234'), URI('http://example.com/me/user#4321')})))) self.assertSetEqual(curr, set(self.backend._graph)) - def test_fetch(self): + def test_get(self): # setup: add some instances Nodes(self.backend, self.user, self.ent_type, {'http://example.com/me/entity#1234'}) \ .set(ns.bse.comment, 'hello world') \ @@ -460,6 +460,11 @@ class TestNodes(unittest.TestCase): Nodes(self.backend, self.user, self.ent_type, {'http://example.com/me/entity#1234'}): {'hello world'}, }) + # FIXME: What if I call `get` with a single predicate and a single node, but + # that node has no value for that predicate? + # so, essentially, what if triples is empty? -> Also check in test_result! + raise NotImplementedError() + def test_getattr(self): nodes = Nodes(self.backend, self.user, self.ent_type, {'http://example.com/me/entity#1234'}) # can get walks to values |