Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/tests/functional/test_snapshot_node.py
Show All 12 Lines | |||||
def test_get_snapshot(client, snapshot): | def test_get_snapshot(client, snapshot): | ||||
query_str = """ | query_str = """ | ||||
query getSnapshot($swhid: SWHID!) { | query getSnapshot($swhid: SWHID!) { | ||||
snapshot(swhid: $swhid) { | snapshot(swhid: $swhid) { | ||||
id | id | ||||
swhid | swhid | ||||
branches(first:5) { | branches(first:5) { | ||||
nodes { | nodes { | ||||
targetType | |||||
name { | name { | ||||
text | text | ||||
} | } | ||||
target { | |||||
type | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
""" | """ | ||||
data, _ = utils.get_query_response(client, query_str, swhid=str(snapshot.swhid())) | data, _ = utils.get_query_response(client, query_str, swhid=str(snapshot.swhid())) | ||||
assert data["snapshot"]["swhid"] == str(snapshot.swhid()) | assert data["snapshot"]["swhid"] == str(snapshot.swhid()) | ||||
assert data["snapshot"]["id"] == snapshot.id.hex() | assert data["snapshot"]["id"] == snapshot.id.hex() | ||||
Show All 30 Lines |