diff --git a/swh/graphql/tests/functional/test_snapshot_node.py b/swh/graphql/tests/functional/test_snapshot_node.py --- a/swh/graphql/tests/functional/test_snapshot_node.py +++ b/swh/graphql/tests/functional/test_snapshot_node.py @@ -11,23 +11,23 @@ @pytest.mark.parametrize("snapshot", get_snapshots()) def test_get_snapshot(client, snapshot): - query_str = f""" - {{ - snapshot(swhid: "{snapshot.swhid()}") {{ + query_str = """ + { + snapshot(swhid: "%s") { id swhid - branches(first:5) {{ - nodes {{ + branches(first:5) { + nodes { type - name {{ + name { text - }} - }} - }} - }} - }} + } + } + } + } + } """ - data, _ = get_query_response(client, query_str) + data, _ = get_query_response(client, query_str % snapshot.swhid()) assert data["snapshot"]["swhid"] == str(snapshot.swhid()) assert data["snapshot"]["id"] == snapshot.id.hex() assert len(data["snapshot"]["branches"]["nodes"]) == len(snapshot.branches) diff --git a/swh/graphql/tests/functional/test_visit_node.py b/swh/graphql/tests/functional/test_visit_node.py --- a/swh/graphql/tests/functional/test_visit_node.py +++ b/swh/graphql/tests/functional/test_visit_node.py @@ -12,35 +12,33 @@ @pytest.mark.parametrize("origin", get_origins()) def test_get_visit(client, storage, origin): query_str = """ - {{ - visit(originUrl: "{origin_url}", visitId: {visit_id}) {{ + { + visit(originUrl: "%s", visitId: %s) { visitId date type - latestStatus {{ + latestStatus { status date type - snapshot {{ + snapshot { swhid - }} - }} - status {{ - nodes {{ + } + } + status { + nodes { status - }} - }} - }} - }} + } + } + } + } """ visits_and_statuses = storage.origin_visit_get_with_statuses(origin.url).results for vws in visits_and_statuses: visit = vws.visit statuses = vws.statuses - data, _ = get_query_response( - client, query_str.format(origin_url=origin.url, visit_id=visit.visit) - ) + data, _ = get_query_response(client, query_str % (origin.url, visit.visit)) assert data["visit"] == { "visitId": visit.visit, "type": visit.type,