Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/mercurial/tests/test_loader.py
Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | assert_last_visit_matches( | ||||
type="hg", | type="hg", | ||||
snapshot=hash_to_bytes("3b8fe58e467deb7597b12a5fd3b2c096b8c02028"), | snapshot=hash_to_bytes("3b8fe58e467deb7597b12a5fd3b2c096b8c02028"), | ||||
) | ) | ||||
@pytest.mark.parametrize( | @pytest.mark.parametrize( | ||||
"error_msg", | "error_msg", | ||||
[ | [ | ||||
b"does not appear to be an hg repository", | b"does not appear to be an HG repository", | ||||
b"404: Not Found", | b"404: Not Found", | ||||
b"404: NOT FOUND", | |||||
b" Name or service not known", | b"Name or service not known", | ||||
], | ], | ||||
) | ) | ||||
def test_visit_error_with_status_not_found( | def test_visit_error_with_status_not_found( | ||||
swh_config, datadir, tmp_path, mocker, error_msg | swh_config, datadir, tmp_path, mocker, error_msg | ||||
): | ): | ||||
"""Not reaching the repo leads to a 'not_found' ingestion status""" | """Not reaching the repo leads to a 'not_found' ingestion status""" | ||||
mock = mocker.patch("hglib.clone") | mock = mocker.patch("hglib.clone") | ||||
mock.side_effect = CommandError((), 255, b"", error_msg) | mock.side_effect = CommandError((), 255, b"", error_msg) | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |