Exemplo n.º 1
0
def test_cannot_join_one_of_other_type():
    foo = "foo"
    with pytest.raises(TypeError):
        Node.join(alice, foo)
Exemplo n.º 2
0
def test_cannot_join_other_types():
    foo = "foo"
    with pytest.raises(TypeError):
        Node.join(foo, foo)
Exemplo n.º 3
0
def test_can_join_equal_pointers():
    assert Node.join(pointer_1, NodePointer(pointer_1.address)) == pointer_1
Exemplo n.º 4
0
def test_can_join_pointer_and_node():
    assert Node.join(pointer_1, None) is pointer_1
Exemplo n.º 5
0
def test_cannot_join_different_pointers():
    with pytest.raises(JoinError):
        Node.join(pointer_1, pointer_2)
Exemplo n.º 6
0
def test_can_join_node_and_none():
    assert Node.join(alice, None) is alice
Exemplo n.º 7
0
def test_cannot_join_different_nodes():
    with pytest.raises(JoinError):
        Node.join(alice, bob)
Exemplo n.º 8
0
def test_can_join_same_nodes():
    assert Node.join(alice, alice) is alice
Exemplo n.º 9
0
def test_cannot_join_different_nodes():
    with pytest.raises(UnjoinableError):
        Node.join(alice, bob)
Exemplo n.º 10
0
def test_can_join_none_and_node():
    assert Node.join(None, alice) is alice
Exemplo n.º 11
0
def test_can_join_node_and_none():
    assert Node.join(alice, None) is alice
Exemplo n.º 12
0
def test_can_join_none_and_none():
    assert Node.join(None, None) is None
Exemplo n.º 13
0
def test_can_join_equal_pointers():
    assert Node.join(pointer_1, NodePointer(pointer_1.address)) == pointer_1
Exemplo n.º 14
0
def test_can_join_similar_bound_nodes():
    alice.bind("http://localhost:7474/db/data/node/1")
    Node.cache.clear()
    alice_2 = Node(name="Alice")
    alice_2.bind(alice.uri)
    assert Node.join(alice, alice_2) == alice
Exemplo n.º 15
0
def test_can_join_none_and_none():
    assert Node.join(None, None) is None
Exemplo n.º 16
0
def test_can_join_none_and_pointer():
    assert Node.join(None, pointer_1) is pointer_1
Exemplo n.º 17
0
def test_can_join_none_and_node():
    assert Node.join(None, alice) is alice
Exemplo n.º 18
0
def test_can_join_pointer_and_node():
    assert Node.join(pointer_1, None) is pointer_1
Exemplo n.º 19
0
def test_can_join_same_nodes():
    assert Node.join(alice, alice) is alice
Exemplo n.º 20
0
def test_can_join_same_pointers():
    assert Node.join(pointer_1, pointer_1) is pointer_1
Exemplo n.º 21
0
def test_can_join_none_and_pointer():
    assert Node.join(None, pointer_1) is pointer_1
Exemplo n.º 22
0
def test_cannot_join_different_pointers():
    with pytest.raises(UnjoinableError):
        Node.join(pointer_1, pointer_2)
Exemplo n.º 23
0
def test_can_join_same_pointers():
    assert Node.join(pointer_1, pointer_1) is pointer_1
Exemplo n.º 24
0
def test_cannot_join_node_and_pointer():
    with pytest.raises(UnjoinableError):
        Node.join(alice, pointer_2)
Exemplo n.º 25
0
def test_cannot_join_node_and_pointer():
    with pytest.raises(JoinError):
        Node.join(alice, pointer_2)
Exemplo n.º 26
0
def test_cannot_join_other_types():
    foo = "foo"
    with pytest.raises(TypeError):
        Node.join(foo, foo)
Exemplo n.º 27
0
def test_cannot_join_one_of_other_type():
    foo = "foo"
    with pytest.raises(TypeError):
        Node.join(alice, foo)
Exemplo n.º 28
0
def test_can_join_similar_bound_nodes():
    alice.bind("http://localhost:7474/db/data/node/1")
    Node.cache.clear()
    alice_2 = Node(name="Alice")
    alice_2.bind(alice.uri)
    assert Node.join(alice, alice_2) == alice