From 8ed8dbb4010a9a75cf6e61d185327825fe783776 Mon Sep 17 00:00:00 2001 From: Matthias Baumgartner Date: Sun, 18 Dec 2022 14:16:40 +0100 Subject: Graph.node interface --- test/graph/test_graph.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/graph/test_graph.py b/test/graph/test_graph.py index f8e107d..33cf6aa 100644 --- a/test/graph/test_graph.py +++ b/test/graph/test_graph.py @@ -74,6 +74,16 @@ class TestGraph(unittest.TestCase): self.assertEqual(graph.schema, self.backend.schema) self.assertRaises(AttributeError, setattr, graph, 'schema', None) + def test_node(self): + graph = Graph(self.backend, self.user) + guid = URI('http://example.com/me/entity#1234') + # returns a Nodes instance + self.assertEqual( + graph.node(ns.bsfs.Entity, guid), + Nodes(self.backend, self.user, graph.schema.node(ns.bsfs.Entity), {guid})) + # node_type must be in the schema + self.assertRaises(KeyError, graph.node, ns.bsfs.Invalid, guid) + def test_nodes(self): graph = Graph(self.backend, self.user) guids = {URI('http://example.com/me/entity#1234'), URI('http://example.com/me/entity#4321')} -- cgit v1.2.3