Changeset View
Changeset View
Standalone View
Standalone View
swh/journal/tests/journal_data.py
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | DATES = [ | ||||
"timestamp": {"seconds": 1234567892, "microseconds": 0,}, | "timestamp": {"seconds": 1234567892, "microseconds": 0,}, | ||||
"offset": 120, | "offset": 120, | ||||
"negative_utc": False, | "negative_utc": False, | ||||
}, | }, | ||||
] | ] | ||||
REVISIONS = [ | REVISIONS = [ | ||||
{ | { | ||||
"id": hash_to_bytes("7026b7c1a2af56521e951c01ed20f255fa054238"), | "id": hash_to_bytes("4ca486e65eb68e4986aeef8227d2db1d56ce51b3"), | ||||
"message": b"hello", | "message": b"hello", | ||||
"date": DATES[0], | "date": DATES[0], | ||||
"committer": COMMITTERS[0], | "committer": COMMITTERS[0], | ||||
"author": COMMITTERS[0], | "author": COMMITTERS[0], | ||||
"committer_date": DATES[0], | "committer_date": DATES[0], | ||||
"type": "git", | "type": "git", | ||||
"directory": b"\x01" * 20, | "directory": b"\x01" * 20, | ||||
"synthetic": False, | "synthetic": False, | ||||
"metadata": None, | "metadata": None, | ||||
"parents": (), | "parents": (), | ||||
}, | }, | ||||
{ | { | ||||
"id": hash_to_bytes("368a48fe15b7db2383775f97c6b247011b3f14f4"), | "id": hash_to_bytes("677063f5c405d6fc1781fc56379c9a9adf43d3a0"), | ||||
"message": b"hello again", | "message": b"hello again", | ||||
"date": DATES[1], | "date": DATES[1], | ||||
"committer": COMMITTERS[1], | "committer": COMMITTERS[1], | ||||
"author": COMMITTERS[1], | "author": COMMITTERS[1], | ||||
"committer_date": DATES[1], | "committer_date": DATES[1], | ||||
"type": "hg", | "type": "hg", | ||||
"directory": b"\x02" * 20, | "directory": b"\x02" * 20, | ||||
"synthetic": False, | "synthetic": False, | ||||
"metadata": None, | "metadata": None, | ||||
"parents": (), | "parents": (), | ||||
}, | }, | ||||
] | ] | ||||
RELEASES = [ | RELEASES = [ | ||||
{ | { | ||||
"id": hash_to_bytes("d81cc0710eb6cf9efd5b920a8453e1e07157b6cd"), | "id": hash_to_bytes("8059dc4e17fcd0e51ca3bcd6b80f4577d281fd08"), | ||||
"name": b"v0.0.1", | "name": b"v0.0.1", | ||||
"date": { | "date": { | ||||
"timestamp": {"seconds": 1234567890, "microseconds": 0,}, | "timestamp": {"seconds": 1234567890, "microseconds": 0,}, | ||||
"offset": 120, | "offset": 120, | ||||
"negative_utc": False, | "negative_utc": False, | ||||
}, | }, | ||||
"author": COMMITTERS[0], | "author": COMMITTERS[0], | ||||
"target_type": "revision", | "target_type": "revision", | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | ORIGIN_VISIT_STATUSES = [ | ||||
"snapshot": None, | "snapshot": None, | ||||
"metadata": None, | "metadata": None, | ||||
}, | }, | ||||
{ | { | ||||
"origin": ORIGINS[0]["url"], | "origin": ORIGINS[0]["url"], | ||||
"date": datetime.datetime(2018, 11, 27, 17, 20, 49, tzinfo=UTC), | "date": datetime.datetime(2018, 11, 27, 17, 20, 49, tzinfo=UTC), | ||||
"visit": 3, | "visit": 3, | ||||
"status": "full", | "status": "full", | ||||
"snapshot": hash_to_bytes("742cdc6be7bf6e895b055227c2300070f056e07b"), | "snapshot": hash_to_bytes("17d0066a4a80aba4a0e913532ee8ff2014f006a9"), | ||||
"metadata": None, | "metadata": None, | ||||
}, | }, | ||||
{ | { | ||||
"origin": ORIGINS[1]["url"], | "origin": ORIGINS[1]["url"], | ||||
"date": datetime.datetime(2015, 11, 27, 17, 22, 18, tzinfo=UTC), | "date": datetime.datetime(2015, 11, 27, 17, 22, 18, tzinfo=UTC), | ||||
"visit": 2, | "visit": 2, | ||||
"status": "partial", | "status": "partial", | ||||
"snapshot": hash_to_bytes("ecee48397a92b0d034e9752a17459f3691a73ef9"), | "snapshot": hash_to_bytes("8ce268b87faf03850693673c3eb5c9bb66e1ca38"), | ||||
"metadata": None, | "metadata": None, | ||||
}, | }, | ||||
] | ] | ||||
DIRECTORIES = [ | DIRECTORIES = [ | ||||
{"id": hash_to_bytes("4b825dc642cb6eb9a060e54bf8d69288fbee4904"), "entries": ()}, | {"id": hash_to_bytes("4b825dc642cb6eb9a060e54bf8d69288fbee4904"), "entries": ()}, | ||||
{ | { | ||||
"id": hash_to_bytes("cc13247a0d6584f297ca37b5868d2cbd242aea03"), | "id": hash_to_bytes("21416d920e0ebf0df4a7888bed432873ed5cb3a7"), | ||||
"entries": ( | "entries": ( | ||||
{ | { | ||||
"name": b"file1.ext", | "name": b"file1.ext", | ||||
"perms": 0o644, | "perms": 0o644, | ||||
"type": "file", | "type": "file", | ||||
"target": CONTENTS[0]["sha1_git"], | "target": CONTENTS[0]["sha1_git"], | ||||
}, | }, | ||||
{ | { | ||||
Show All 10 Lines | DIRECTORIES = [ | ||||
}, | }, | ||||
), | ), | ||||
}, | }, | ||||
] | ] | ||||
SNAPSHOTS = [ | SNAPSHOTS = [ | ||||
{ | { | ||||
"id": hash_to_bytes("742cdc6be7bf6e895b055227c2300070f056e07b"), | "id": hash_to_bytes("17d0066a4a80aba4a0e913532ee8ff2014f006a9"), | ||||
"branches": { | "branches": { | ||||
b"master": {"target_type": "revision", "target": REVISIONS[0]["id"]} | b"master": {"target_type": "revision", "target": REVISIONS[0]["id"]} | ||||
}, | }, | ||||
}, | }, | ||||
{ | { | ||||
"id": hash_to_bytes("ecee48397a92b0d034e9752a17459f3691a73ef9"), | "id": hash_to_bytes("8ce268b87faf03850693673c3eb5c9bb66e1ca38"), | ||||
"branches": { | "branches": { | ||||
b"target/revision": { | b"target/revision": { | ||||
"target_type": "revision", | "target_type": "revision", | ||||
"target": REVISIONS[0]["id"], | "target": REVISIONS[0]["id"], | ||||
}, | }, | ||||
b"target/alias": {"target_type": "alias", "target": b"target/revision"}, | b"target/alias": {"target_type": "alias", "target": b"target/revision"}, | ||||
b"target/directory": { | b"target/directory": { | ||||
"target_type": "directory", | "target_type": "directory", | ||||
"target": DIRECTORIES[0]["id"], | "target": DIRECTORIES[0]["id"], | ||||
}, | }, | ||||
b"target/release": {"target_type": "release", "target": RELEASES[0]["id"]}, | b"target/release": {"target_type": "release", "target": RELEASES[0]["id"]}, | ||||
b"target/snapshot": { | b"target/snapshot": { | ||||
"target_type": "snapshot", | "target_type": "snapshot", | ||||
"target": hash_to_bytes("742cdc6be7bf6e895b055227c2300070f056e07b"), | "target": hash_to_bytes("17d0066a4a80aba4a0e913532ee8ff2014f006a9"), | ||||
}, | }, | ||||
}, | }, | ||||
}, | }, | ||||
] | ] | ||||
TEST_OBJECT_DICTS: Dict[str, List[Dict[str, Any]]] = { | TEST_OBJECT_DICTS: Dict[str, List[Dict[str, Any]]] = { | ||||
"content": CONTENTS, | "content": CONTENTS, | ||||
Show All 29 Lines |