Ejemplo n.º 1
0
 def test_can_pull_relationship(self):
     a = Node()
     b = Node()
     alpha = Relationship(a, "TO", b, since=1999)
     beta = Relationship(a, "TO", b)
     self.graph.create(alpha)
     assert dict(beta) == {}
     beta.__remote__ = RemoteEntity(remote(alpha).uri)
     beta.pull()
     assert dict(beta) == dict(alpha)
Ejemplo n.º 2
0
 def test_can_bind_relationship_to_resource(self):
     uri = "http://localhost:7474/db/relationship/1"
     metadata = {
         "start": "http://localhost:7474/db/node/1",
         "end": "http://localhost:7474/db/node/2",
     }
     relationship = Relationship({}, "", {})
     # Pass in metadata to avoid callback to server
     relationship.__remote__ = RemoteEntity(uri, metadata=metadata)
     assert remote(relationship)
     assert isinstance(remote(relationship), Resource)
     assert remote(relationship).uri == uri