Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/tests/functional/test_revision.py
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | query getRevision($swhid: SWHID!) { | ||||
} | } | ||||
} | } | ||||
""" | """ | ||||
data, _ = utils.get_query_response(client, query_str, swhid=str(revision.swhid())) | data, _ = utils.get_query_response(client, query_str, swhid=str(revision.swhid())) | ||||
assert data["revision"] == { | assert data["revision"] == { | ||||
"swhid": str(revision.swhid()), | "swhid": str(revision.swhid()), | ||||
"message": {"text": revision.message.decode()}, | "message": {"text": revision.message.decode()}, | ||||
"author": { | "author": [ | ||||
{ | |||||
"fullname": {"text": revision.author.fullname.decode()}, | "fullname": {"text": revision.author.fullname.decode()}, | ||||
"name": {"text": revision.author.name.decode()}, | "name": {"text": revision.author.name.decode()}, | ||||
"email": {"text": revision.author.email.decode()}, | "email": {"text": revision.author.email.decode()}, | ||||
}, | } | ||||
"committer": { | ], | ||||
"committer": [ | |||||
{ | |||||
"fullname": {"text": revision.committer.fullname.decode()}, | "fullname": {"text": revision.committer.fullname.decode()}, | ||||
"name": {"text": revision.committer.name.decode()}, | "name": {"text": revision.committer.name.decode()}, | ||||
"email": {"text": revision.committer.email.decode()}, | "email": {"text": revision.committer.email.decode()}, | ||||
}, | } | ||||
], | |||||
"date": { | "date": { | ||||
"date": revision.date.to_datetime().isoformat(), | "date": revision.date.to_datetime().isoformat(), | ||||
"offset": { | "offset": { | ||||
"text": revision.date.offset_bytes.decode(), | "text": revision.date.offset_bytes.decode(), | ||||
"base64": base64.b64encode(revision.date.offset_bytes).decode("ascii"), | "base64": base64.b64encode(revision.date.offset_bytes).decode("ascii"), | ||||
}, | }, | ||||
} | } | ||||
if revision.date | if revision.date | ||||
▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines |