Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/package/tests/test_loader.py
# Copyright (C) 2019 The Software Heritage developers | # Copyright (C) 2019 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 unittest | import unittest | ||||
import os | import os | ||||
import requests_mock | import requests_mock | ||||
from typing import List | |||||
from swh.loader.package.loader import GNULoader | from swh.loader.package.loader import GNULoader | ||||
from swh.loader.core.tests import BaseLoaderStorageTest | from swh.loader.core.tests import BaseLoaderStorageTest | ||||
from swh.loader.package.tests.common import ( | from swh.loader.package.tests.common import ( | ||||
package, package_url, | package, package_url, | ||||
tarball, init_test_data | tarball, init_test_data | ||||
) | ) | ||||
_LOADER_TESTS_CONFIG = { | _LOADER_TESTS_CONFIG = { | ||||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | _expected_branches_first_visit = { | ||||
}, | }, | ||||
'release/8sync-0.1.0': { | 'release/8sync-0.1.0': { | ||||
'target': '44183488c0774ce3c957fa19ba695cf18a4a42b3', | 'target': '44183488c0774ce3c957fa19ba695cf18a4a42b3', | ||||
'target_type': 'revision' | 'target_type': 'revision' | ||||
}, | }, | ||||
} | } | ||||
_expected_new_snapshot_first_visit = '2ae491bbaeef7351641997d1b9193aa2a67d26bc' # noqa | _expected_new_snapshot_first_visit = '2ae491bbaeef7351641997d1b9193aa2a67d26bc' # noqa | ||||
_expected_new_contents_invalid_origin = [] | _expected_new_contents_invalid_origin = [] # type: List[str] | ||||
_expected_new_directories_invalid_origin = [] | _expected_new_directories_invalid_origin = [] # type: List[str] | ||||
@classmethod | @classmethod | ||||
def setUpClass(cls): | def setUpClass(cls): | ||||
cls.reset_loader() | cls.reset_loader() | ||||
@classmethod | @classmethod | ||||
def reset_loader(cls): | def reset_loader(cls): | ||||
cls.loader = GNULoaderTest() | cls.loader = GNULoaderTest() | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |