Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/tests/functional/test_revision.py
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | def test_get_revision_with_invalid_swhid(client): | ||||
{ | { | ||||
revision(swhid: "swh:1:cnt:invalid") { | revision(swhid: "swh:1:cnt:invalid") { | ||||
swhid | swhid | ||||
} | } | ||||
} | } | ||||
""" | """ | ||||
errors = utils.get_error_response(client, query_str) | errors = utils.get_error_response(client, query_str) | ||||
# API will throw an error in case of an invalid SWHID | # API will throw an error in case of an invalid SWHID | ||||
assert len(errors) == 1 | assert len(errors) == 2 | ||||
assert "Invalid SWHID: invalid syntax" in errors[0]["message"] | assert "Invalid SWHID: invalid syntax" in errors[1]["message"] | ||||
def test_get_revision_as_target(client): | def test_get_revision_as_target(client): | ||||
# SWHID of a snapshot with revision as target | # SWHID of a snapshot with revision as target | ||||
snapshot_swhid = "swh:1:snp:9e78d7105c5e0f886487511e2a92377b4ee4c32a" | snapshot_swhid = "swh:1:snp:9e78d7105c5e0f886487511e2a92377b4ee4c32a" | ||||
query_str = """ | query_str = """ | ||||
{ | { | ||||
snapshot(swhid: "%s") { | snapshot(swhid: "%s") { | ||||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |