diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-02-08 21:14:36 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-02-08 21:14:36 +0100 |
commit | c0218a8dffcdc3a7a5568f66bb959139fe514ad5 (patch) | |
tree | 5fc3d3b8864a8ff996e5739ed9654dae494d9d8f /test | |
parent | f31a0d005785d474a37ec769c1f7f5e27aa08a57 (diff) | |
download | bsfs-c0218a8dffcdc3a7a5568f66bb959139fe514ad5.tar.gz bsfs-c0218a8dffcdc3a7a5568f66bb959139fe514ad5.tar.bz2 bsfs-c0218a8dffcdc3a7a5568f66bb959139fe514ad5.zip |
Graph.all to retrieve all nodes
Diffstat (limited to 'test')
-rw-r--r-- | test/graph/test_graph.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/graph/test_graph.py b/test/graph/test_graph.py index f97783b..5db1fd2 100644 --- a/test/graph/test_graph.py +++ b/test/graph/test_graph.py @@ -95,6 +95,19 @@ class TestGraph(unittest.TestCase): # node_type must be in the schema self.assertRaises(KeyError, graph.nodes, ns.bsfs.Invalid, guids) + def test_all(self): + graph = Graph(self.backend, self.user) + # resulting nodes can be empty + self.assertEqual(graph.all(ns.bsfs.Entity), + Nodes(self.backend, self.user, graph.schema.node(ns.bsfs.Entity), set())) + # resulting nodes contains all nodes of the respective type + guids = {URI('http://example.com/me/entity#1234'), URI('http://example.com/me/entity#4321')} + self.backend.create(graph.schema.node(ns.bsfs.Entity), guids) + self.assertEqual(graph.all(ns.bsfs.Entity), + Nodes(self.backend, self.user, graph.schema.node(ns.bsfs.Entity), guids)) + # node_type must be in the schema + self.assertRaises(KeyError, graph.all, ns.bsfs.Invalid) + def test_migrate(self): # setup graph = Graph(self.backend, self.user) |