Ejemplo n.º 1
0
def test_count(graph):
    assert graph.find(V(1).knows).count() == 3
    assert graph.find(V(1).likes).count() == 2
Ejemplo n.º 2
0
def test_find(graph):
    assert list(graph.find(V(1).knows)) == [2, 3, 4]
    assert list(graph.find(V().knows(1))) == [2, 3]
Ejemplo n.º 3
0
def test_nested_traverse(graph):
    query = graph.find(V(1).likes)\
                 .traverse(V().knows)\
                 .traverse(V().knows)
    assert query.to(list) == [2, 3, 4]
Ejemplo n.º 4
0
def test_traverse(graph):
    assert list(graph.find(V(1).knows).traverse(V().knows)) == [1, 1]
    assert list(graph.find(V(1).knows).traverse(V().knows(1))) == [2, 3]
Ejemplo n.º 5
0
def test_difference(graph):
    assert list(graph.find(V(1).knows).difference(V().knows(1))) == [4]
Ejemplo n.º 6
0
def test_intersection(graph):
    assert list(graph.find(V(1).knows).intersection(V().knows(1))) == [2, 3]