swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f06483b29b0>
requests_mock = <requests_mock.mocker.Mocker object at 0x7f064816fba8>
maven_index_full = b'doc 0\n field 0\n name u\n type string\n value al.aldi|sprova4j|0.1.0|sources|jar\n field 1\n name m\n...otGroups\n field 19\n name rootGroupsList\n type string\n value com|al\nEND\nchecksum 00000000004102281591\n'
maven_index_incr_first = b'doc 0\n field 0\n name u\n type string\n value al.aldi|sprova4j|0.1.0|sources|jar\n field 1\n name m\n...tring\n value sprova4j\n field 11\n name d\n type string\n value Java client for Sprova Test Management\n'
def test_maven_incremental_listing(
swh_scheduler,
requests_mock,
maven_index_full,
maven_index_incr_first,
):
"""Covers full listing of multiple pages, checking page results and listed
origins, with a second updated run for statefulness."""
lister = MavenLister(
scheduler=swh_scheduler,
url=MVN_URL,
instance="maven.org",
index_url=INDEX_URL,
incremental=True,
)
# Set up test.
requests_mock.get(INDEX_URL, content=maven_index_incr_first)
# Then run the lister.
stats = lister.run()
# Start test checks.
assert lister.incremental
assert lister.updated
assert stats.pages == 2
scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results
origin_urls = [origin.url for origin in scheduler_origins]
# 1 git origins + 1 maven origin with 1 release (one per jar)
assert len(origin_urls) == 2
> assert sorted(origin_urls) == sorted(LIST_GIT + LIST_SRC)
E AssertionError: assert ['git://githu...ldi/sprova4j'] == ['https://git...ldi/sprova4j']
E At index 0 diff: 'git://github.com/aldialimucaj/sprova4j.git' != 'https://github.com/aldialimucaj/sprova4j'
E Full diff:
E [
E - 'https://github.com/aldialimucaj/sprova4j',
E ? ^ ---
E + 'git://github.com/aldialimucaj/sprova4j.git',
E ? ^^ ++++...
E
E ...Full output truncated (3 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/lister/maven/tests/test_lister.py:234: AssertionError
TEST RESULT
TEST RESULT
- Run At
- May 20 2022, 5:52 PM