Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/storage_tests.py
Show First 20 Lines • Show All 1,082 Lines • ▼ Show 20 Lines | def test_revision_add_fractional_timezone(self, swh_storage, sample_data): | ||||
# and on the CI (both because psycopg2 >= 2.9.0 and TZ=UTC); but which means | # and on the CI (both because psycopg2 >= 2.9.0 and TZ=UTC); but which means | ||||
# this test is only useful on machines with older psycopg2 versions and | # this test is only useful on machines with older psycopg2 versions and | ||||
# TZ=Europe/Paris. But the workaround is also only needed on this kind of | # TZ=Europe/Paris. But the workaround is also only needed on this kind of | ||||
# configuration, so this is good enough. | # configuration, so this is good enough. | ||||
revision = attr.evolve( | revision = attr.evolve( | ||||
sample_data.revision, | sample_data.revision, | ||||
date=TimestampWithTimezone( | date=TimestampWithTimezone( | ||||
timestamp=Timestamp(seconds=-1855958962, microseconds=0), | timestamp=Timestamp(seconds=-1855958962, microseconds=0), | ||||
offset=0, | offset_bytes=b"+0000", | ||||
negative_utc=False, | |||||
), | ), | ||||
) | ) | ||||
init_missing = swh_storage.revision_missing([revision.id]) | init_missing = swh_storage.revision_missing([revision.id]) | ||||
assert list(init_missing) == [revision.id] | assert list(init_missing) == [revision.id] | ||||
actual_result = swh_storage.revision_add([revision]) | actual_result = swh_storage.revision_add([revision]) | ||||
assert actual_result == {"revision:add": 1} | assert actual_result == {"revision:add": 1} | ||||
▲ Show 20 Lines • Show All 3,876 Lines • Show Last 20 Lines |