Changeset View
Changeset View
Standalone View
Standalone View
swh/graph/tests/test_api_client.py
Show First 20 Lines • Show All 212 Lines • ▼ Show 20 Lines | expected = [ | ||||
( | ( | ||||
"swh:1:dir:0000000000000000000000000000000000000006", | "swh:1:dir:0000000000000000000000000000000000000006", | ||||
"swh:1:cnt:0000000000000000000000000000000000000005", | "swh:1:cnt:0000000000000000000000000000000000000005", | ||||
), | ), | ||||
] | ] | ||||
assert set(actual) == set(expected) | assert set(actual) == set(expected) | ||||
def test_visit_paths(graph_client): | |||||
actual = list( | |||||
graph_client.visit_paths( | |||||
"swh:1:snp:0000000000000000000000000000000000000020", edges="snp:*,rev:*" | |||||
) | |||||
) | |||||
actual = [tuple(path) for path in actual] | |||||
expected = [ | |||||
( | |||||
"swh:1:snp:0000000000000000000000000000000000000020", | |||||
"swh:1:rev:0000000000000000000000000000000000000009", | |||||
"swh:1:rev:0000000000000000000000000000000000000003", | |||||
"swh:1:dir:0000000000000000000000000000000000000002", | |||||
), | |||||
( | |||||
"swh:1:snp:0000000000000000000000000000000000000020", | |||||
"swh:1:rev:0000000000000000000000000000000000000009", | |||||
"swh:1:dir:0000000000000000000000000000000000000008", | |||||
), | |||||
( | |||||
"swh:1:snp:0000000000000000000000000000000000000020", | |||||
"swh:1:rel:0000000000000000000000000000000000000010", | |||||
), | |||||
] | |||||
assert set(actual) == set(expected) | |||||
@pytest.mark.skip(reason="currently disabled due to T1969") | @pytest.mark.skip(reason="currently disabled due to T1969") | ||||
def test_walk(graph_client): | def test_walk(graph_client): | ||||
args = ("swh:1:dir:0000000000000000000000000000000000000016", "rel") | args = ("swh:1:dir:0000000000000000000000000000000000000016", "rel") | ||||
kwargs = { | kwargs = { | ||||
"edges": "dir:dir,dir:rev,rev:*", | "edges": "dir:dir,dir:rev,rev:*", | ||||
"direction": "backward", | "direction": "backward", | ||||
"traversal": "bfs", | "traversal": "bfs", | ||||
} | } | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |