def test_can_infer_nodes_through_relationships(self): s = Subgraph([], [alice_knows_bob]) self.assertSetEqual(s.nodes, {alice, bob}) self.assertSetEqual(s.relationships, {alice_knows_bob})
def test_empty_subgraph(self): with self.assertRaises(ValueError): Subgraph()
def test_empty_subgraph(self): s = Subgraph() assert len(s.nodes) == 0 assert len(s.relationships) == 0