swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f06480d0048>
requests_mock = <requests_mock.mocker.Mocker object at 0x7f06480d0da0>
maven_pom_1_malformed = b'<?xml version="1.0" encoding="UTF-8"?>\n<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven....actId>\n <version>3.10.0</version>\n <scope>test</scope>\n </dependency>\n </dependencies>\n</project>\n'
def test_maven_full_listing_malformed(
swh_scheduler,
requests_mock,
maven_pom_1_malformed,
):
"""Covers full listing of multiple pages, checking page results with a malformed
scm entry in pom."""
lister = MavenLister(
scheduler=swh_scheduler,
url=MVN_URL,
instance="maven.org",
index_url=INDEX_URL,
incremental=False,
)
# Set up test.
requests_mock.get(URL_POM_1, content=maven_pom_1_malformed)
# Then run the lister.
stats = lister.run()
# Start test checks.
assert stats.pages == 5
scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results
origin_urls = [origin.url for origin in scheduler_origins]
# 2 git origins + 1 maven origin with 2 releases (one per jar)
assert len(origin_urls) == 3
> assert sorted(origin_urls) == sorted(LIST_GIT + LIST_GIT_INCR + LIST_SRC)
E AssertionError: assert ['git://githu...ldi/sprova4j'] == ['https://git...ldi/sprova4j']
E At index 0 diff: 'git://github.com/ArangoDB-Community/arangodb-graphql-java.git' != 'https://github.com/ArangoDB-Community/arangodb-graphql-java'
E Full diff:
E [
E - 'https://github.com/ArangoDB-Community/arangodb-graphql-java',
E ? ^ ---
E + 'git://github.com/ArangoDB-Community/arangodb-graphql-java.git',
E ? ^^ ++++...
E
E ...Full output truncated (4 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/lister/maven/tests/test_lister.py:186: AssertionError
TEST RESULT
TEST RESULT
- Run At
- May 20 2022, 5:52 PM