Changeset View
Changeset View
Standalone View
Standalone View
swh/model/tests/swh_model_data.py
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | Revision( | ||||
b"parent 9B918DD063CEC85C2BC63CC7F167E29F5894DCBC" # upper-cased | b"parent 9B918DD063CEC85C2BC63CC7F167E29F5894DCBC" # upper-cased | ||||
b"nauthor foo 1234567891 +0200\n" | b"nauthor foo 1234567891 +0200\n" | ||||
b"committer foo 1234567891 +0200" | b"committer foo 1234567891 +0200" | ||||
b"\n\nhello" | b"\n\nhello" | ||||
), | ), | ||||
), | ), | ||||
] | ] | ||||
EXTIDS = [ | |||||
ExtID( | |||||
extid_type="git256", | |||||
extid=b"\x03" * 32, | |||||
target=REVISIONS[0].swhid(), | |||||
), | |||||
ExtID( | |||||
extid_type="hg", | |||||
extid=b"\x04" * 20, | |||||
target=REVISIONS[1].swhid(), | |||||
), | |||||
ExtID( | |||||
extid_type="hg-nodeid", | |||||
extid=b"\x05" * 20, | |||||
target=REVISIONS[1].swhid(), | |||||
extid_version=1, | |||||
), | |||||
] | |||||
RELEASES = [ | RELEASES = [ | ||||
Release( | Release( | ||||
id=hash_to_bytes("8059dc4e17fcd0e51ca3bcd6b80f4577d281fd08"), | id=hash_to_bytes("8059dc4e17fcd0e51ca3bcd6b80f4577d281fd08"), | ||||
name=b"v0.0.1", | name=b"v0.0.1", | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone( | ||||
timestamp=Timestamp( | timestamp=Timestamp( | ||||
seconds=1234567890, | seconds=1234567890, | ||||
microseconds=0, | microseconds=0, | ||||
▲ Show 20 Lines • Show All 246 Lines • ▼ Show 20 Lines | RawExtrinsicMetadata( | ||||
discovery_date=datetime.datetime(2020, 7, 30, 17, 8, 20, tzinfo=UTC), | discovery_date=datetime.datetime(2020, 7, 30, 17, 8, 20, tzinfo=UTC), | ||||
authority=attr.evolve(METADATA_AUTHORITIES[0], metadata=None), | authority=attr.evolve(METADATA_AUTHORITIES[0], metadata=None), | ||||
fetcher=attr.evolve(METADATA_FETCHERS[0], metadata=None), | fetcher=attr.evolve(METADATA_FETCHERS[0], metadata=None), | ||||
format="json", | format="json", | ||||
metadata=b'{"foo": "bar"}', | metadata=b'{"foo": "bar"}', | ||||
), | ), | ||||
] | ] | ||||
EXTIDS = [ | |||||
ExtID( | |||||
extid_type="git256", | |||||
extid=b"\x03" * 32, | |||||
target=REVISIONS[0].swhid(), | |||||
), | |||||
ExtID( | |||||
extid_type="hg", | |||||
extid=b"\x04" * 20, | |||||
target=REVISIONS[1].swhid(), | |||||
), | |||||
ExtID( | |||||
extid_type="hg-nodeid", | |||||
extid=b"\x05" * 20, | |||||
target=REVISIONS[1].swhid(), | |||||
extid_version=1, | |||||
), | |||||
ExtID( | |||||
extid_type="tarball-sha256", | |||||
extid=b"\x03" * 32, | |||||
target=DIRECTORIES[0].swhid(), | |||||
payload_type="disarchive", | |||||
payload=CONTENTS[0].sha1_git, | |||||
), | |||||
] | |||||
TEST_OBJECTS: Dict[str, Sequence[BaseModel]] = { | TEST_OBJECTS: Dict[str, Sequence[BaseModel]] = { | ||||
"content": CONTENTS, | "content": CONTENTS, | ||||
"directory": DIRECTORIES, | "directory": DIRECTORIES, | ||||
"extid": EXTIDS, | "extid": EXTIDS, | ||||
"metadata_authority": METADATA_AUTHORITIES, | "metadata_authority": METADATA_AUTHORITIES, | ||||
"metadata_fetcher": METADATA_FETCHERS, | "metadata_fetcher": METADATA_FETCHERS, | ||||
"origin": ORIGINS, | "origin": ORIGINS, | ||||
Show All 24 Lines |