swh_storage = <swh.storage.filter.FilteringProxyStorage object at 0x7fdb8923e320>
datadir = '/var/lib/jenkins/workspace/DLDHG/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/loader/mercurial/tests/data'
tmp_path = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_visit_error_with_status_n2')
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fdb8923e4a8>
error_msg = b'404: NOT FOUND'
@pytest.mark.parametrize(
"error_msg",
[
b"does not appear to be an HG repository",
b"404: Not Found",
b"404: NOT FOUND",
b"Name or service not known",
],
)
def test_visit_error_with_status_not_found(
swh_storage, datadir, tmp_path, mocker, error_msg
):
"""Not reaching the repo leads to a 'not_found' ingestion status"""
mock = mocker.patch("hglib.clone")
mock.side_effect = CommandError((), 255, b"", error_msg)
archive_name = "the-sandbox"
archive_path = os.path.join(datadir, f"{archive_name}.tgz")
repo_url = prepare_repository_from_archive(archive_path, archive_name, tmp_path)
> loader = HgBundle20Loader(swh_storage, repo_url)
.tox/py3/lib/python3.7/site-packages/swh/loader/mercurial/tests/test_loader.py:255:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/loader/mercurial/loader.py:142: in __init__
os.environ.update(get_minimum_env())
.tox/py3/lib/python3.7/site-packages/swh/loader/mercurial/utils.py:36: in get_minimum_env
"PATH": os.environ["PATH"],
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = environ({}), key = 'PATH'
def __getitem__(self, key):
try:
value = self._data[self.encodekey(key)]
except KeyError:
# raise KeyError with the original key value
> raise KeyError(key) from None
E KeyError: 'PATH'
/usr/lib/python3.7/os.py:678: KeyError
TEST RESULT
TEST RESULT
- Run At
- Feb 25 2021, 3:58 PM