diff --git a/swh/loader/package/nixguix/tests/test_nixguix.py b/swh/loader/package/nixguix/tests/test_nixguix.py --- a/swh/loader/package/nixguix/tests/test_nixguix.py +++ b/swh/loader/package/nixguix/tests/test_nixguix.py @@ -265,7 +265,7 @@ loader.storage, sources_url, status="partial", type="nixguix" ) - (_, visit_status) = origin_get_latest_visit_status(loader.storage, sources_url) + visit_status = origin_get_latest_visit_status(loader.storage, sources_url) snapshot_swhid = SWHID( object_type="snapshot", object_id=hash_to_hex(visit_status.snapshot) ) diff --git a/swh/loader/tests/__init__.py b/swh/loader/tests/__init__.py --- a/swh/loader/tests/__init__.py +++ b/swh/loader/tests/__init__.py @@ -44,11 +44,12 @@ the visit status for further check during the remaining part of the test. """ - visit_and_status = origin_get_latest_visit_status(storage, url) - assert visit_and_status is not None, f"Origin {url} has no visits" - visit, visit_status = visit_and_status + visit_status = origin_get_latest_visit_status(storage, url) + assert visit_status is not None, f"Origin {url} has no visits" if type: - assert visit.type == type, f"Visit has type {visit.type} instead of {type}" + assert ( + visit_status.type == type + ), f"Visit has type {visit_status.type} instead of {type}" assert ( visit_status.status == status ), f"Visit_status has status {visit_status.status} instead of {status}" diff --git a/swh/loader/tests/test_init.py b/swh/loader/tests/test_init.py --- a/swh/loader/tests/test_init.py +++ b/swh/loader/tests/test_init.py @@ -52,6 +52,7 @@ ORIGIN_VISIT_STATUS = OriginVisitStatus( origin="some-url", visit=1, + type="archive", date=datetime.datetime.now(tz=datetime.timezone.utc), status="full", snapshot=hash_to_bytes("d81cc0710eb6cf9efd5b920a8453e1e07157b6cd"), @@ -165,7 +166,7 @@ @pytest.fixture def mock_storage(mocker): mock_storage = mocker.patch("swh.loader.tests.origin_get_latest_visit_status") - mock_storage.return_value = ORIGIN_VISIT, ORIGIN_VISIT_STATUS + mock_storage.return_value = ORIGIN_VISIT_STATUS return mock_storage