Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/tests/functional/test_revision.py
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | query_str = """ | ||||
} | } | ||||
} | } | ||||
""" | """ | ||||
data, _ = utils.get_query_response(client, query_str % snapshot_swhid) | data, _ = utils.get_query_response(client, query_str % snapshot_swhid) | ||||
revision_obj = data["snapshot"]["branches"]["nodes"][0]["target"] | revision_obj = data["snapshot"]["branches"]["nodes"][0]["target"] | ||||
assert revision_obj == { | assert revision_obj == { | ||||
"swhid": "swh:1:rev:66c7c1cd9673275037140f2abff7b7b11fc9439c" | "swhid": "swh:1:rev:66c7c1cd9673275037140f2abff7b7b11fc9439c" | ||||
} | } | ||||
def test_get_revision_log(client): | |||||
revision_swhid = "swh:1:rev:37580d63b8dcc0ec73e74994e66896858542844c" | |||||
query_str = """ | |||||
{ | |||||
revision(swhid: "%s") { | |||||
swhid | |||||
revisionLog(first: 3) { | |||||
nodes { | |||||
swhid | |||||
} | |||||
} | |||||
} | |||||
} | |||||
""" | |||||
data, _ = utils.get_query_response(client, query_str % revision_swhid) | |||||
assert data["revision"]["revisionLog"] == { | |||||
"nodes": [ | |||||
{"swhid": "swh:1:rev:37580d63b8dcc0ec73e74994e66896858542844c"}, | |||||
ardumont: i guess? (it's probably missing the hash to hex yadi yada though) | |||||
{"swhid": "swh:1:rev:66c7c1cd9673275037140f2abff7b7b11fc9439c"}, | |||||
{"swhid": "swh:1:rev:c7f96242d73c267adc77c2908e64e0c1cb6a4431"}, | |||||
] | |||||
} | |||||
def test_get_revision_parents(client): | |||||
revision_swhid = "swh:1:rev:37580d63b8dcc0ec73e74994e66896858542844c" | |||||
query_str = """ | |||||
{ | |||||
revision(swhid: "%s") { | |||||
swhid | |||||
parents { | |||||
nodes { | |||||
swhid | |||||
} | |||||
} | |||||
} | |||||
} | |||||
""" | |||||
data, _ = utils.get_query_response(client, query_str % revision_swhid) | |||||
assert data["revision"]["parents"] == { | |||||
"nodes": [ | |||||
{"swhid": "swh:1:rev:66c7c1cd9673275037140f2abff7b7b11fc9439c"}, | |||||
{"swhid": "swh:1:rev:c7f96242d73c267adc77c2908e64e0c1cb6a4431"}, | |||||
] | |||||
} |
i guess? (it's probably missing the hash to hex yadi yada though)