diff options
Diffstat (limited to 'test/graph')
-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) |