Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/cran/tests/test_cran.py
Show All 21 Lines | |||||
from swh.model.hashutil import hash_to_bytes | from swh.model.hashutil import hash_to_bytes | ||||
from swh.model.model import ( | from swh.model.model import ( | ||||
ObjectType, | ObjectType, | ||||
Person, | Person, | ||||
Release, | Release, | ||||
Snapshot, | Snapshot, | ||||
SnapshotBranch, | SnapshotBranch, | ||||
TargetType, | TargetType, | ||||
Timestamp, | |||||
TimestampWithTimezone, | TimestampWithTimezone, | ||||
) | ) | ||||
RELEASE_ID = hash_to_bytes("daaf3cffedac946060de53648994631d0b3c63bc") | RELEASE_ID = hash_to_bytes("daaf3cffedac946060de53648994631d0b3c63bc") | ||||
SNAPSHOT = Snapshot( | SNAPSHOT = Snapshot( | ||||
id=hash_to_bytes("c0ccd6452cbe9cd4f0a523b23f09c411bd92ef4e"), | id=hash_to_bytes("c0ccd6452cbe9cd4f0a523b23f09c411bd92ef4e"), | ||||
branches={ | branches={ | ||||
▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | assert swh_storage.release_get([RELEASE_ID])[0] == Release( | ||||
target=hash_to_bytes("ff64177fea3f4a5136b9caf7581a4f7d4cf65296"), | target=hash_to_bytes("ff64177fea3f4a5136b9caf7581a4f7d4cf65296"), | ||||
target_type=ObjectType.DIRECTORY, | target_type=ObjectType.DIRECTORY, | ||||
synthetic=True, | synthetic=True, | ||||
author=Person( | author=Person( | ||||
fullname=b"Brian Ripley <ripley@stats.ox.ac.uk>", | fullname=b"Brian Ripley <ripley@stats.ox.ac.uk>", | ||||
name=b"Brian Ripley", | name=b"Brian Ripley", | ||||
email=b"ripley@stats.ox.ac.uk", | email=b"ripley@stats.ox.ac.uk", | ||||
), | ), | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone.from_datetime( | ||||
timestamp=Timestamp(seconds=991958400, microseconds=0), | datetime(2001, 6, 8, 0, 0, tzinfo=timezone.utc) | ||||
offset=0, | |||||
negative_utc=False, | |||||
), | ), | ||||
) | ) | ||||
visit_stats = get_stats(swh_storage) | visit_stats = get_stats(swh_storage) | ||||
assert { | assert { | ||||
"content": 33, | "content": 33, | ||||
"directory": 7, | "directory": 7, | ||||
"origin": 1, | "origin": 1, | ||||
▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines |