Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/storage_data.py
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | skipped_content2 = SkippedContent( | ||||
blake2s256=hash_to_bytes( | blake2s256=hash_to_bytes( | ||||
"9ce18b1adecb33f891ca36664da676e12c772cc193778aac9a137b8dc5834b9b" | "9ce18b1adecb33f891ca36664da676e12c772cc193778aac9a137b8dc5834b9b" | ||||
), | ), | ||||
reason="Content too long", | reason="Content too long", | ||||
status="absent", | status="absent", | ||||
) | ) | ||||
skipped_contents: Tuple[SkippedContent, ...] = (skipped_content, skipped_content2) | skipped_contents: Tuple[SkippedContent, ...] = (skipped_content, skipped_content2) | ||||
directory5 = Directory(entries=()) | directory5 = Directory( | ||||
id=hash_to_bytes("4b825dc642cb6eb9a060e54bf8d69288fbee4904"), entries=(), | |||||
) | |||||
directory = Directory( | directory = Directory( | ||||
id=hash_to_bytes("5256e856a0a0898966d6ba14feb4388b8b82d302"), | id=hash_to_bytes("5256e856a0a0898966d6ba14feb4388b8b82d302"), | ||||
entries=tuple( | entries=tuple( | ||||
[ | [ | ||||
DirectoryEntry( | DirectoryEntry( | ||||
name=b"foo", | name=b"foo", | ||||
type="file", | type="file", | ||||
target=content.sha1_git, | target=content.sha1_git, | ||||
Show All 17 Lines | directory2 = Directory( | ||||
type="file", | type="file", | ||||
target=content2.sha1_git, | target=content2.sha1_git, | ||||
perms=from_disk.DentryPerms.content, | perms=from_disk.DentryPerms.content, | ||||
) | ) | ||||
], | ], | ||||
), | ), | ||||
) | ) | ||||
directory3 = Directory( | directory3 = Directory( | ||||
id=hash_to_bytes("4ea8c6b2f54445e5dd1a9d5bb2afd875d66f3150"), | id=hash_to_bytes("13089e6e544f78df7c9a40a3059050d10dee686a"), | ||||
entries=tuple( | entries=tuple( | ||||
[ | [ | ||||
DirectoryEntry( | DirectoryEntry( | ||||
name=b"foo", | name=b"foo", | ||||
type="file", | type="file", | ||||
target=content.sha1_git, | target=content.sha1_git, | ||||
perms=from_disk.DentryPerms.content, | perms=from_disk.DentryPerms.content, | ||||
), | ), | ||||
DirectoryEntry( | DirectoryEntry( | ||||
name=b"subdir", | name=b"subdir", | ||||
type="dir", | type="dir", | ||||
target=directory.id, | target=directory.id, | ||||
perms=from_disk.DentryPerms.directory, | perms=from_disk.DentryPerms.directory, | ||||
), | ), | ||||
DirectoryEntry( | DirectoryEntry( | ||||
name=b"hello", | name=b"hello", | ||||
type="file", | type="file", | ||||
target=content2.sha1_git, | target=content2.sha1_git, | ||||
perms=from_disk.DentryPerms.content, | perms=from_disk.DentryPerms.content, | ||||
), | ), | ||||
], | ], | ||||
), | ), | ||||
) | ) | ||||
directory4 = Directory( | directory4 = Directory( | ||||
id=hash_to_bytes("377aa5fcd944fbabf502dbfda55cd14d33c8c3c6"), | id=hash_to_bytes("cd5dfd9c09d9e99ed123bc7937a0d5fddc3cd531"), | ||||
entries=tuple( | entries=tuple( | ||||
[ | [ | ||||
DirectoryEntry( | DirectoryEntry( | ||||
name=b"subdir1", | name=b"subdir1", | ||||
type="dir", | type="dir", | ||||
target=directory3.id, | target=directory3.id, | ||||
perms=from_disk.DentryPerms.directory, | perms=from_disk.DentryPerms.directory, | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | revision = Revision( | ||||
extra_headers=( | extra_headers=( | ||||
(b"gpgsig", b"test123"), | (b"gpgsig", b"test123"), | ||||
(b"mergetag", b"foo\\bar"), | (b"mergetag", b"foo\\bar"), | ||||
(b"mergetag", b"\x22\xaf\x89\x80\x01\x00"), | (b"mergetag", b"\x22\xaf\x89\x80\x01\x00"), | ||||
), | ), | ||||
synthetic=True, | synthetic=True, | ||||
) | ) | ||||
revision2 = Revision( | revision2 = Revision( | ||||
id=hash_to_bytes("df7a6f6a99671fb7f7343641aff983a314ef6161"), | id=hash_to_bytes("a646dd94c912829659b22a1e7e143d2fa5ebde1b"), | ||||
message=b"hello again", | message=b"hello again", | ||||
author=Person( | author=Person( | ||||
name=b"Roberto Dicosmo", | name=b"Roberto Dicosmo", | ||||
email=b"roberto@example.com", | email=b"roberto@example.com", | ||||
fullname=b"Roberto Dicosmo <roberto@example.com>", | fullname=b"Roberto Dicosmo <roberto@example.com>", | ||||
), | ), | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1234567843, microseconds=220000,), | timestamp=Timestamp(seconds=1234567843, microseconds=220000,), | ||||
Show All 11 Lines | revision2 = Revision( | ||||
parents=tuple([revision.id]), | parents=tuple([revision.id]), | ||||
type=RevisionType.GIT, | type=RevisionType.GIT, | ||||
directory=directory2.id, | directory=directory2.id, | ||||
metadata=None, | metadata=None, | ||||
extra_headers=(), | extra_headers=(), | ||||
synthetic=False, | synthetic=False, | ||||
) | ) | ||||
revision3 = Revision( | revision3 = Revision( | ||||
id=hash_to_bytes("2cbd7bb22c653bbb23a29657852a50a01b591d46"), | id=hash_to_bytes("beb2844dff30658e27573cb46eb55980e974b391"), | ||||
message=b"a simple revision with no parents this time", | message=b"a simple revision with no parents this time", | ||||
author=Person( | author=Person( | ||||
name=b"Roberto Dicosmo", | name=b"Roberto Dicosmo", | ||||
email=b"roberto@example.com", | email=b"roberto@example.com", | ||||
fullname=b"Roberto Dicosmo <roberto@example.com>", | fullname=b"Roberto Dicosmo <roberto@example.com>", | ||||
), | ), | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1234567843, microseconds=220000,), | timestamp=Timestamp(seconds=1234567843, microseconds=220000,), | ||||
Show All 11 Lines | revision3 = Revision( | ||||
parents=tuple([revision.id, revision2.id]), | parents=tuple([revision.id, revision2.id]), | ||||
type=RevisionType.GIT, | type=RevisionType.GIT, | ||||
directory=directory2.id, | directory=directory2.id, | ||||
metadata=None, | metadata=None, | ||||
extra_headers=(), | extra_headers=(), | ||||
synthetic=True, | synthetic=True, | ||||
) | ) | ||||
revision4 = Revision( | revision4 = Revision( | ||||
id=hash_to_bytes("88cd5126fc958ed70089d5340441a1c2477bcc20"), | id=hash_to_bytes("ae860aec43700c7f5a295e2ef47e2ae41b535dfe"), | ||||
message=b"parent of self.revision2", | message=b"parent of self.revision2", | ||||
author=Person( | author=Person( | ||||
name=b"me", email=b"me@soft.heri", fullname=b"me <me@soft.heri>", | name=b"me", email=b"me@soft.heri", fullname=b"me <me@soft.heri>", | ||||
), | ), | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1234567843, microseconds=220000,), | timestamp=Timestamp(seconds=1234567843, microseconds=220000,), | ||||
offset=-720, | offset=-720, | ||||
negative_utc=False, | negative_utc=False, | ||||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | hg_revision3 = Revision( | ||||
directory=directory2.id, | directory=directory2.id, | ||||
metadata=None, | metadata=None, | ||||
extra_headers=( | extra_headers=( | ||||
(b"node", hash_to_bytes("7f294a01c49065a90b3fe8b4ad49f08ce9656ef6")), | (b"node", hash_to_bytes("7f294a01c49065a90b3fe8b4ad49f08ce9656ef6")), | ||||
), | ), | ||||
synthetic=True, | synthetic=True, | ||||
) | ) | ||||
hg_revision4 = Revision( | hg_revision4 = Revision( | ||||
id=hash_to_bytes("42070a39e5387e9b99bb3d83674e3a4a1ff39b69"), | id=hash_to_bytes("4683324ba26dfe941a72cc7552e86eaaf7c27fe3"), | ||||
message=b"parent of self.revision2", | message=b"parent of self.revision2", | ||||
author=Person( | author=Person( | ||||
name=b"me", email=b"me@soft.heri", fullname=b"me <me@soft.heri>", | name=b"me", email=b"me@soft.heri", fullname=b"me <me@soft.heri>", | ||||
), | ), | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1234567843, microseconds=220000,), | timestamp=Timestamp(seconds=1234567843, microseconds=220000,), | ||||
offset=-720, | offset=-720, | ||||
negative_utc=False, | negative_utc=False, | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | release = Release( | ||||
negative_utc=False, | negative_utc=False, | ||||
), | ), | ||||
target=revision.id, | target=revision.id, | ||||
target_type=ObjectType.REVISION, | target_type=ObjectType.REVISION, | ||||
message=b"synthetic release", | message=b"synthetic release", | ||||
synthetic=True, | synthetic=True, | ||||
) | ) | ||||
release2 = Release( | release2 = Release( | ||||
id=hash_to_bytes("6902bd4c82b7d19a421d224aedab2b74197e420d"), | id=hash_to_bytes("db81a26783a3f4a9db07b4759ffc37621f159bb2"), | ||||
name=b"v0.0.2", | name=b"v0.0.2", | ||||
author=Person( | author=Person( | ||||
name=b"tony", email=b"ar@dumont.fr", fullname=b"tony <ar@dumont.fr>", | name=b"tony", email=b"ar@dumont.fr", fullname=b"tony <ar@dumont.fr>", | ||||
), | ), | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1634366813, microseconds=0), | timestamp=Timestamp(seconds=1634366813, microseconds=0), | ||||
offset=-120, | offset=-120, | ||||
negative_utc=False, | negative_utc=False, | ||||
), | ), | ||||
target=revision2.id, | target=revision2.id, | ||||
target_type=ObjectType.REVISION, | target_type=ObjectType.REVISION, | ||||
message=b"v0.0.2\nMisc performance improvements + bug fixes", | message=b"v0.0.2\nMisc performance improvements + bug fixes", | ||||
synthetic=False, | synthetic=False, | ||||
) | ) | ||||
release3 = Release( | release3 = Release( | ||||
id=hash_to_bytes("3e9050196aa288264f2a9d279d6abab8b158448b"), | id=hash_to_bytes("1c5d42e603ce2eea44917fadca76c78bad76aeb9"), | ||||
name=b"v0.0.2", | name=b"v0.0.2", | ||||
author=Person( | author=Person( | ||||
name=b"tony", | name=b"tony", | ||||
email=b"tony@ardumont.fr", | email=b"tony@ardumont.fr", | ||||
fullname=b"tony <tony@ardumont.fr>", | fullname=b"tony <tony@ardumont.fr>", | ||||
), | ), | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1634366813, microseconds=0), | timestamp=Timestamp(seconds=1634366813, microseconds=0), | ||||
Show All 15 Lines | snapshot = Snapshot( | ||||
target=revision.id, target_type=TargetType.REVISION, | target=revision.id, target_type=TargetType.REVISION, | ||||
), | ), | ||||
}, | }, | ||||
) | ) | ||||
empty_snapshot = Snapshot( | empty_snapshot = Snapshot( | ||||
id=hash_to_bytes("1a8893e6a86f444e8be8e7bda6cb34fb1735a00e"), branches={}, | id=hash_to_bytes("1a8893e6a86f444e8be8e7bda6cb34fb1735a00e"), branches={}, | ||||
) | ) | ||||
complete_snapshot = Snapshot( | complete_snapshot = Snapshot( | ||||
id=hash_to_bytes("a56ce2d81c190023bb99a3a36279307522cb85f6"), | id=hash_to_bytes("db99fda25b43dc5cd90625ee4b0744751799c917"), | ||||
branches={ | branches={ | ||||
b"directory": SnapshotBranch( | b"directory": SnapshotBranch( | ||||
target=directory.id, target_type=TargetType.DIRECTORY, | target=directory.id, target_type=TargetType.DIRECTORY, | ||||
), | ), | ||||
b"directory2": SnapshotBranch( | b"directory2": SnapshotBranch( | ||||
target=directory2.id, target_type=TargetType.DIRECTORY, | target=directory2.id, target_type=TargetType.DIRECTORY, | ||||
), | ), | ||||
b"content": SnapshotBranch( | b"content": SnapshotBranch( | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |