def test_node_does_not_exist(self): batch = Batch(self.graph) a = batch.create_node() b = batch.create_node() ab = batch.create_rel(a, b, "KNOWS") result = batch.submit() alice = next(result) bob = next(result) alice_bob = next(result) alice_bob_rel = alice_bob.rels[0] Batch.single(self.graph, Batch.delete_rel, alice_bob_rel._id) assert not alice_bob_rel.exists
def test_local_node_changes_can_be_pushed(self): batch = Batch(self.graph) batch.create_node() result = batch.submit() remote = next(result) local = Node("Person", name="Alice") local.bind(self.graph, id=remote._id) local.push() remote = Batch.single(self.graph, Batch.get_node, local._id) assert remote.labels == local.labels assert remote.properties == local.properties
def test_local_rel_changes_can_be_pushed(self): batch = Batch(self.graph) a = batch.create_node() b = batch.create_node() ab = batch.create_rel(a, b, "KNOWS") result = batch.submit() alice = next(result) bob = next(result) alice_bob = next(result) local = Rel("KNOWS", since=1999) local.bind(self.graph, id=alice_bob._id) local.push() remote = Batch.single(self.graph, Batch.get_rel, local._id) assert remote.type == local.type assert remote.properties == local.properties
def test_local_rel_changes_can_be_pushed(self): batch = Batch(self.graph) a = batch.create_node() b = batch.create_node() ab = batch.create_rel(a, b, "KNOWS") result = batch.submit() alice = next(result) bob = next(result) alice_bob = next(result) local = Rel("KNOWS", since=1999) local.bind(self.graph, id=alice_bob._id) local.push() remote = Batch.single(self.graph, Batch.get_rel, local._id) assert remote.type == local.type assert remote.properties == local.properties