def test_can_push_relationship(graph):
    local = Rel("KNOWS", since=1999)
    remote = Rel("KNOWS")
    a, b, ab = graph.create({}, {}, (0, remote, 1))
    assert ab.properties == {}
    local.bind(ab.uri)
    ab.push()
    local.pull()
    assert local.properties == remote.properties
def test_can_push_rel(graph):
    local = Rel("KNOWS", since=1999)
    remote = Rel("KNOWS")
    graph.create({}, {}, (0, remote, 1))
    assert remote.properties == {}
    local.bind(remote.uri)
    local.push()
    remote.pull()
    assert local.properties == remote.properties
Example #3
0
def test_can_push_relationship(graph):
    local = Rel("KNOWS", since=1999)
    remote = Rel("KNOWS")
    a, b, ab = graph.create({}, {}, (0, remote, 1))
    assert ab.properties == {}
    local.bind(ab.uri)
    ab.push()
    local.pull()
    assert local.properties == remote.properties
Example #4
0
def test_can_push_rel(graph):
    local = Rel("KNOWS", since=1999)
    remote = Rel("KNOWS")
    graph.create({}, {}, (0, remote, 1))
    assert remote.properties == {}
    local.bind(remote.uri)
    local.push()
    remote.pull()
    assert local.properties == remote.properties
Example #5
0
def test_can_bind_rel_to_resource():
    uri = "http://localhost:7474/db/relationship/1"
    rel = Rel()
    rel.bind(uri)
    assert rel.bound
    assert isinstance(rel.resource, Resource)
    assert rel.resource.uri == uri
    rel.unbind()
    assert not rel.bound
    with pytest.raises(BindError):
        _ = rel.resource
Example #6
0
def test_can_bind_rel_to_resource():
    uri = "http://localhost:7474/db/relationship/1"
    rel = Rel()
    rel.bind(uri)
    assert rel.bound
    assert isinstance(rel.resource, Resource)
    assert rel.resource.uri == uri
    rel.unbind()
    assert not rel.bound
    with pytest.raises(BindError):
        r = rel.resource