Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/tests/test_conflict_resolution.py
# Copyright (C) 2021 The Software Heritage developers | # Copyright (C) 2021-2022 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
from datetime import datetime | from datetime import datetime | ||||
from typing import List, Tuple, Union | from typing import List, Tuple, Union | ||||
from swh.model.hashutil import hash_to_bytes | from swh.model.hashutil import hash_to_bytes | ||||
from swh.model.model import Sha1Git | from swh.model.model import Sha1Git | ||||
from swh.provenance.api.server import ( | from swh.provenance.storage.interface import DirectoryData, RelationData, RevisionData | ||||
from swh.provenance.storage.rabbitmq.server import ( | |||||
resolve_dates, | resolve_dates, | ||||
resolve_directory, | resolve_directory, | ||||
resolve_relation, | resolve_relation, | ||||
resolve_revision, | resolve_revision, | ||||
) | ) | ||||
from swh.provenance.interface import DirectoryData, RelationData, RevisionData | |||||
def test_resolve_dates() -> None: | def test_resolve_dates() -> None: | ||||
items: List[Tuple[Sha1Git, datetime]] = [ | items: List[Tuple[Sha1Git, datetime]] = [ | ||||
( | ( | ||||
hash_to_bytes("20329687bb9c1231a7e05afe86160343ad49b494"), | hash_to_bytes("20329687bb9c1231a7e05afe86160343ad49b494"), | ||||
datetime.fromtimestamp(1000000001), | datetime.fromtimestamp(1000000001), | ||||
), | ), | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |