Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/tests/test_loader.py
# Copyright (C) 2019-2021 The Software Heritage developers | # Copyright (C) 2019-2021 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 | ||||
import datetime | import datetime | ||||
import hashlib | import hashlib | ||||
import string | import string | ||||
from unittest.mock import Mock, call, patch | from unittest.mock import Mock, call, patch | ||||
import attr | import attr | ||||
import pytest | import pytest | ||||
from swh.loader.package.loader import BasePackageInfo, PackageLoader | from swh.loader.package.loader import BasePackageInfo, PackageLoader | ||||
from swh.model.identifiers import CoreSWHID, ObjectType | |||||
from swh.model.model import ( | from swh.model.model import ( | ||||
ExtID, | ExtID, | ||||
Origin, | Origin, | ||||
OriginVisit, | OriginVisit, | ||||
OriginVisitStatus, | OriginVisitStatus, | ||||
Snapshot, | Snapshot, | ||||
SnapshotBranch, | SnapshotBranch, | ||||
TargetType, | TargetType, | ||||
) | ) | ||||
from swh.model.swhids import CoreSWHID, ObjectType | |||||
from swh.storage import get_storage | from swh.storage import get_storage | ||||
from swh.storage.algos.snapshot import snapshot_get_latest | from swh.storage.algos.snapshot import snapshot_get_latest | ||||
class FakeStorage: | class FakeStorage: | ||||
def origin_add(self, origins): | def origin_add(self, origins): | ||||
raise ValueError("We refuse to add an origin") | raise ValueError("We refuse to add an origin") | ||||
▲ Show 20 Lines • Show All 286 Lines • Show Last 20 Lines |