Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/tests/functional/test_release_node.py
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | def test_get_release(client, release): | ||||
assert data["release"] == { | assert data["release"] == { | ||||
"swhid": str(release.swhid()), | "swhid": str(release.swhid()), | ||||
"name": { | "name": { | ||||
"text": release.name.decode(), | "text": release.name.decode(), | ||||
"base64": base64.b64encode(release.name).decode("ascii"), | "base64": base64.b64encode(release.name).decode("ascii"), | ||||
}, | }, | ||||
"message": {"text": release.message.decode()}, | "message": {"text": release.message.decode()}, | ||||
"author": { | "author": [ | ||||
{ | |||||
"email": {"text": release.author.email.decode()}, | "email": {"text": release.author.email.decode()}, | ||||
"name": {"text": release.author.name.decode()}, | "name": {"text": release.author.name.decode()}, | ||||
"fullname": {"text": release.author.fullname.decode()}, | "fullname": {"text": release.author.fullname.decode()}, | ||||
} | } | ||||
] | |||||
if release.author | if release.author | ||||
else None, | else [], | ||||
"date": { | "date": { | ||||
"date": release.date.to_datetime().isoformat(), | "date": release.date.to_datetime().isoformat(), | ||||
"offset": { | "offset": { | ||||
"text": release.date.offset_bytes.decode(), | "text": release.date.offset_bytes.decode(), | ||||
"base64": base64.b64encode(release.date.offset_bytes).decode("ascii"), | "base64": base64.b64encode(release.date.offset_bytes).decode("ascii"), | ||||
}, | }, | ||||
} | } | ||||
if release.date | if release.date | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |