Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/git/tests/test_from_disk.py
# Copyright (C) 2018-2020 The Software Heritage developers | # Copyright (C) 2018-2020 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 copy | import copy | ||||
import datetime | import datetime | ||||
import os.path | import os.path | ||||
import dulwich.repo | import dulwich.repo | ||||
import pytest | import pytest | ||||
from unittest import TestCase | from unittest import TestCase | ||||
from swh.model.model import Snapshot, SnapshotBranch, TargetType | from swh.model.model import Snapshot, SnapshotBranch, TargetType | ||||
from swh.model.hashutil import hash_to_bytes | from swh.model.hashutil import hash_to_bytes | ||||
from swh.loader.tests.common import assert_last_visit_matches | from swh.loader.git.from_disk import GitLoaderFromDisk, GitLoaderFromArchive | ||||
from swh.loader.git.from_disk import GitLoaderFromDisk | |||||
from swh.loader.git.from_disk import GitLoaderFromArchive | |||||
from swh.loader.package.tests.common import check_snapshot, get_stats | |||||
from swh.loader.git.tests import prepare_repository_from_archive | from swh.loader.tests import ( | ||||
assert_last_visit_matches, | |||||
check_snapshot, | |||||
get_stats, | |||||
prepare_repository_from_archive, | |||||
) | |||||
SNAPSHOT_ID = "a23699280a82a043f8c0994cf1631b568f716f95" | SNAPSHOT_ID = "a23699280a82a043f8c0994cf1631b568f716f95" | ||||
SNAPSHOT1 = { | SNAPSHOT1 = { | ||||
"id": SNAPSHOT_ID, | "id": SNAPSHOT_ID, | ||||
"branches": { | "branches": { | ||||
"HEAD": {"target": "refs/heads/master", "target_type": "alias",}, | "HEAD": {"target": "refs/heads/master", "target_type": "alias",}, | ||||
▲ Show 20 Lines • Show All 394 Lines • Show Last 20 Lines |