Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/storage_data.py
Show First 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | revision = Revision( | ||||
message=b"hello", | message=b"hello", | ||||
author=Person( | author=Person( | ||||
name=b"Nicolas Dandrimont", | name=b"Nicolas Dandrimont", | ||||
email=b"nicolas@example.com", | email=b"nicolas@example.com", | ||||
fullname=b"Nicolas Dandrimont <nicolas@example.com> ", | fullname=b"Nicolas Dandrimont <nicolas@example.com> ", | ||||
), | ), | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1234567890, microseconds=0), | timestamp=Timestamp(seconds=1234567890, microseconds=0), | ||||
offset=120, | offset_bytes=b"+0200", | ||||
negative_utc=False, | |||||
), | ), | ||||
committer=Person( | committer=Person( | ||||
name=b"St\xc3fano Zacchiroli", | name=b"St\xc3fano Zacchiroli", | ||||
email=b"stefano@example.com", | email=b"stefano@example.com", | ||||
fullname=b"St\xc3fano Zacchiroli <stefano@example.com>", | fullname=b"St\xc3fano Zacchiroli <stefano@example.com>", | ||||
), | ), | ||||
committer_date=TimestampWithTimezone( | committer_date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1123456789, microseconds=0), | timestamp=Timestamp(seconds=1123456789, microseconds=0), | ||||
offset=120, | offset_bytes=b"+0200", | ||||
negative_utc=False, | |||||
), | ), | ||||
parents=(), | parents=(), | ||||
type=RevisionType.GIT, | type=RevisionType.GIT, | ||||
directory=directory.id, | directory=directory.id, | ||||
metadata={ | metadata={ | ||||
"checksums": {"sha1": "tarball-sha1", "sha256": "tarball-sha256",}, | "checksums": {"sha1": "tarball-sha1", "sha256": "tarball-sha256",}, | ||||
"signed-off-by": "some-dude", | "signed-off-by": "some-dude", | ||||
}, | }, | ||||
Show All 9 Lines | revision2 = Revision( | ||||
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,), | ||||
offset=-720, | offset_bytes=b"-1200", | ||||
negative_utc=False, | |||||
), | ), | ||||
committer=Person( | committer=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>", | ||||
), | ), | ||||
committer_date=TimestampWithTimezone( | committer_date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1123456789, microseconds=220000,), | timestamp=Timestamp(seconds=1123456789, microseconds=220000,), | ||||
offset=0, | offset_bytes=b"+0000", | ||||
negative_utc=False, | |||||
), | ), | ||||
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("beb2844dff30658e27573cb46eb55980e974b391"), | 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,), | ||||
offset=-720, | offset_bytes=b"-1200", | ||||
negative_utc=False, | |||||
), | ), | ||||
committer=Person( | committer=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>", | ||||
), | ), | ||||
committer_date=TimestampWithTimezone( | committer_date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1127351742, microseconds=220000,), | timestamp=Timestamp(seconds=1127351742, microseconds=220000,), | ||||
offset=0, | offset_bytes=b"+0000", | ||||
negative_utc=False, | |||||
), | ), | ||||
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("ae860aec43700c7f5a295e2ef47e2ae41b535dfe"), | 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_bytes=b"-1200", | ||||
negative_utc=False, | |||||
), | ), | ||||
committer=Person( | committer=Person( | ||||
name=b"committer-dude", | name=b"committer-dude", | ||||
email=b"committer@dude.com", | email=b"committer@dude.com", | ||||
fullname=b"committer-dude <committer@dude.com>", | fullname=b"committer-dude <committer@dude.com>", | ||||
), | ), | ||||
committer_date=TimestampWithTimezone( | committer_date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1244567843, microseconds=220000,), | timestamp=Timestamp(seconds=1244567843, microseconds=220000,), | ||||
offset=-720, | offset_bytes=b"-1200", | ||||
negative_utc=False, | |||||
), | ), | ||||
parents=tuple([revision3.id]), | parents=tuple([revision3.id]), | ||||
type=RevisionType.GIT, | type=RevisionType.GIT, | ||||
directory=directory.id, | directory=directory.id, | ||||
metadata=None, | metadata=None, | ||||
extra_headers=(), | extra_headers=(), | ||||
synthetic=False, | synthetic=False, | ||||
) | ) | ||||
git_revisions: Tuple[Revision, ...] = (revision, revision2, revision3, revision4) | git_revisions: Tuple[Revision, ...] = (revision, revision2, revision3, revision4) | ||||
hg_revision = Revision( | hg_revision = Revision( | ||||
id=hash_to_bytes("951c9503541e7beaf002d7aebf2abd1629084c68"), | id=hash_to_bytes("951c9503541e7beaf002d7aebf2abd1629084c68"), | ||||
message=b"hello", | message=b"hello", | ||||
author=Person( | author=Person( | ||||
name=b"Nicolas Dandrimont", | name=b"Nicolas Dandrimont", | ||||
email=b"nicolas@example.com", | email=b"nicolas@example.com", | ||||
fullname=b"Nicolas Dandrimont <nicolas@example.com> ", | fullname=b"Nicolas Dandrimont <nicolas@example.com> ", | ||||
), | ), | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1234567890, microseconds=0), | timestamp=Timestamp(seconds=1234567890, microseconds=0), | ||||
offset=120, | offset_bytes=b"+0200", | ||||
negative_utc=False, | |||||
), | ), | ||||
committer=Person( | committer=Person( | ||||
name=b"St\xc3fano Zacchiroli", | name=b"St\xc3fano Zacchiroli", | ||||
email=b"stefano@example.com", | email=b"stefano@example.com", | ||||
fullname=b"St\xc3fano Zacchiroli <stefano@example.com>", | fullname=b"St\xc3fano Zacchiroli <stefano@example.com>", | ||||
), | ), | ||||
committer_date=TimestampWithTimezone( | committer_date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1123456789, microseconds=0), | timestamp=Timestamp(seconds=1123456789, microseconds=0), | ||||
offset=120, | offset_bytes=b"+0200", | ||||
negative_utc=False, | |||||
), | ), | ||||
parents=(), | parents=(), | ||||
type=RevisionType.MERCURIAL, | type=RevisionType.MERCURIAL, | ||||
directory=directory.id, | directory=directory.id, | ||||
metadata={ | metadata={ | ||||
"checksums": {"sha1": "tarball-sha1", "sha256": "tarball-sha256",}, | "checksums": {"sha1": "tarball-sha1", "sha256": "tarball-sha256",}, | ||||
"signed-off-by": "some-dude", | "signed-off-by": "some-dude", | ||||
"node": "a316dfb434af2b451c1f393496b7eaeda343f543", | "node": "a316dfb434af2b451c1f393496b7eaeda343f543", | ||||
}, | }, | ||||
extra_headers=(), | extra_headers=(), | ||||
synthetic=True, | synthetic=True, | ||||
) | ) | ||||
hg_revision2 = Revision( | hg_revision2 = Revision( | ||||
id=hash_to_bytes("df4afb063236300eb13b96a0d7fff03f7b7cbbaf"), | id=hash_to_bytes("df4afb063236300eb13b96a0d7fff03f7b7cbbaf"), | ||||
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,), | ||||
offset=-720, | offset_bytes=b"-1200", | ||||
negative_utc=False, | |||||
), | ), | ||||
committer=Person( | committer=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>", | ||||
), | ), | ||||
committer_date=TimestampWithTimezone( | committer_date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1123456789, microseconds=220000,), | timestamp=Timestamp(seconds=1123456789, microseconds=220000,), | ||||
offset=0, | offset_bytes=b"+0000", | ||||
negative_utc=False, | |||||
), | ), | ||||
parents=tuple([hg_revision.id]), | parents=tuple([hg_revision.id]), | ||||
type=RevisionType.MERCURIAL, | type=RevisionType.MERCURIAL, | ||||
directory=directory2.id, | directory=directory2.id, | ||||
metadata=None, | metadata=None, | ||||
extra_headers=( | extra_headers=( | ||||
(b"node", hash_to_bytes("fa1b7c84a9b40605b67653700f268349a6d6aca1")), | (b"node", hash_to_bytes("fa1b7c84a9b40605b67653700f268349a6d6aca1")), | ||||
), | ), | ||||
synthetic=False, | synthetic=False, | ||||
) | ) | ||||
hg_revision3 = Revision( | hg_revision3 = Revision( | ||||
id=hash_to_bytes("84d8e7081b47ebb88cad9fa1f25de5f330872a37"), | id=hash_to_bytes("84d8e7081b47ebb88cad9fa1f25de5f330872a37"), | ||||
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,), | ||||
offset=-720, | offset_bytes=b"-1200", | ||||
negative_utc=False, | |||||
), | ), | ||||
committer=Person( | committer=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>", | ||||
), | ), | ||||
committer_date=TimestampWithTimezone( | committer_date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1127351742, microseconds=220000,), | timestamp=Timestamp(seconds=1127351742, microseconds=220000,), | ||||
offset=0, | offset_bytes=b"+0000", | ||||
negative_utc=False, | |||||
), | ), | ||||
parents=tuple([hg_revision.id, hg_revision2.id]), | parents=tuple([hg_revision.id, hg_revision2.id]), | ||||
type=RevisionType.MERCURIAL, | type=RevisionType.MERCURIAL, | ||||
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("4683324ba26dfe941a72cc7552e86eaaf7c27fe3"), | 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_bytes=b"-1200", | ||||
negative_utc=False, | |||||
), | ), | ||||
committer=Person( | committer=Person( | ||||
name=b"committer-dude", | name=b"committer-dude", | ||||
email=b"committer@dude.com", | email=b"committer@dude.com", | ||||
fullname=b"committer-dude <committer@dude.com>", | fullname=b"committer-dude <committer@dude.com>", | ||||
), | ), | ||||
committer_date=TimestampWithTimezone( | committer_date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1244567843, microseconds=220000,), | timestamp=Timestamp(seconds=1244567843, microseconds=220000,), | ||||
offset=-720, | offset_bytes=b"-1200", | ||||
negative_utc=False, | |||||
), | ), | ||||
parents=tuple([hg_revision3.id]), | parents=tuple([hg_revision3.id]), | ||||
type=RevisionType.MERCURIAL, | type=RevisionType.MERCURIAL, | ||||
directory=directory.id, | directory=directory.id, | ||||
metadata=None, | metadata=None, | ||||
extra_headers=( | extra_headers=( | ||||
(b"node", hash_to_bytes("f4160af0485c85823d9e829bae2c00b00a2e6297")), | (b"node", hash_to_bytes("f4160af0485c85823d9e829bae2c00b00a2e6297")), | ||||
), | ), | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | class StorageData: | ||||
release = Release( | release = Release( | ||||
id=hash_to_bytes("f7f222093a18ec60d781070abec4a630c850b837"), | id=hash_to_bytes("f7f222093a18ec60d781070abec4a630c850b837"), | ||||
name=b"v0.0.1", | name=b"v0.0.1", | ||||
author=Person( | author=Person( | ||||
name=b"olasd", email=b"nic@olasd.fr", fullname=b"olasd <nic@olasd.fr>", | name=b"olasd", email=b"nic@olasd.fr", fullname=b"olasd <nic@olasd.fr>", | ||||
), | ), | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=1234567890, microseconds=0), | timestamp=Timestamp(seconds=1234567890, microseconds=0), | ||||
offset=42, | offset_bytes=b"+0042", | ||||
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("db81a26783a3f4a9db07b4759ffc37621f159bb2"), | 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_bytes=b"-0200", | ||||
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("1c5d42e603ce2eea44917fadca76c78bad76aeb9"), | 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), | ||||
offset=-120, | offset_bytes=b"-0200", | ||||
negative_utc=False, | |||||
), | ), | ||||
target=revision3.id, | target=revision3.id, | ||||
target_type=ObjectType.REVISION, | target_type=ObjectType.REVISION, | ||||
message=b"yet another synthetic release", | message=b"yet another synthetic release", | ||||
synthetic=True, | synthetic=True, | ||||
) | ) | ||||
releases: Tuple[Release, ...] = (release, release2, release3) | releases: Tuple[Release, ...] = (release, release2, release3) | ||||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |