swh_storage = <swh.storage.proxies.retry.RetryingProxyStorage object at 0x7fd5db3442e8>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7fd5db2d0940>
def test_base_loader_forked_origin(swh_storage, mocker):
fetcher_cls = MagicMock(wraps=DummyMetadataFetcherWithFork)
fetcher_cls.SUPPORTED_LISTERS = DummyMetadataFetcherWithFork.SUPPORTED_LISTERS
fetcher_cls.FETCHER_NAME = "fake-forge"
mocker.patch(
"swh.loader.core.metadata_fetchers._fetchers", return_value=[fetcher_cls]
)
statsd_report = mocker.patch("swh.core.statsd.statsd._report")
loader = DummyBaseLoader(
swh_storage, lister_name="fake-forge", lister_instance_name=""
)
result = loader.load()
assert result == {"status": "eventful"}
fetcher_cls.assert_called_once()
fetcher_cls.assert_called_once_with(
origin=ORIGIN,
credentials={},
lister_name="fake-forge",
lister_instance_name="",
)
assert swh_storage.raw_extrinsic_metadata_get(
ORIGIN.swhid(), METADATA_AUTHORITY
).results == [REMD]
assert loader.parent_origins == [PARENT_ORIGIN]
> assert [
call(
"swh.loader.core.metadata.fetchers",
"h",
1,
{"visit_type": "git"},
1,
),
call(
"swh.loader.core.metadata.parent_origins",
"h",
1,
{"fetcher": "fake-forge", "visit_type": "git"},
1,
),
call(
"swh.loader.core.metadata.objects",
"h",
1,
{"visit_type": "git"},
1,
),
] == [c for c in statsd_report.mock_calls if ".metadata." in c.args[0]]
E AssertionError: assert [call('swh.lo...': 'git'}, 1)] == []
E Left contains 3 more items, first extra item: call('swh.loader.core.metadata.fetchers', 'h', 1, {'visit_type': 'git'}, 1)
E Full diff:
E [
E - ,
E + call('swh.loader.core.metadata.fetchers', 'h', 1, {'visit_type': 'git'}, 1),
E + call('swh.loader.core.metadata.parent_origins', 'h', 1, {'fetcher': 'fake-forge', 'visit_type': 'git'}, 1),
E + call('swh.loader.core.metadata.objects', 'h', 1, {'visit_type': 'git'}, 1),...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/loader/core/tests/test_loader.py:219: AssertionError
TEST RESULT
TEST RESULT
- Run At
- May 3 2022, 2:23 PM