swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f85ca577320>
requests_mock = <requests_mock.mocker.Mocker object at 0x7f85ca5124e0>
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
E AssertionError: assert 4 == 3
E + where 4 = len(['git://github.com/ArangoDB-Community/arangodb-graphql-java.git', 'https://github.com/aldialimucaj/sprova4j.git', 'https://repo1.maven.org/maven2/al/aldi/sprova4j', 'scm:https://github.com/aldialimucaj/sprova4j.git'])
.tox/py3/lib/python3.7/site-packages/swh/lister/maven/tests/test_lister.py:179: AssertionError
TEST RESULT
TEST RESULT
- Run At
- May 20 2022, 5:02 PM