Skip to content
Snippets Groups Projects
Verified Commit a3d66736 authored by Antoine Lambert's avatar Antoine Lambert
Browse files

maven: Update test that is now failing since beautifulsoup4 4.13

Latest beautifulsoup4 release (4.13) seems to have fixed issues
related to unexpected encodings in XML files so a test that was
passing previously is now failing.

Update that test to check origin URL and visit type can be
successfully extracted from a POM file with unexpected encoding.
parent 4d14e892
No related branches found
No related tags found
1 merge request!546maven: Remove test that is now failing after beautifulsoup4 upgrade
Pipeline #13070 passed
beautifulsoup4
beautifulsoup4 >= 4.13.3
breezy >= 3.3.1, < 3.3.5 # use versions with available binary wheels
dateparser
dulwich
......
......@@ -356,8 +356,9 @@ def test_maven_lister_null_mtime(swh_scheduler, requests_mock, maven_index_null_
def test_maven_list_pom_bad_encoding(swh_scheduler, requests_mock):
"""should continue listing when failing to decode pom file."""
# Test failure of pom parsing by reencoding a UTF-8 pom file to a not expected one
"""should successfully parse a pom file with unexpected encoding
(beautifulsoup4 >= 4.13)."""
# Test pom parsing by reencoding a UTF-8 pom file to a not expected one
requests_mock.get(
URL_POM_1,
content=requests.get(URL_POM_1).content.decode("utf-8").encode("utf-32"),
......@@ -367,10 +368,14 @@ def test_maven_list_pom_bad_encoding(swh_scheduler, requests_mock):
lister.run()
# If the maven_index_full step succeeded but not the pom parsing step,
# then we get only one maven-jar origin and one git origin.
# we should get one maven-jar origin and two git origins.
scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results
assert len(scheduler_origins) == 2
assert len(scheduler_origins) == 3
# git origin parsed from pom file with unexpected encoding
assert ("https://github.com/aldialimucaj/sprova4j", "git") in [
(o.url, o.visit_type) for o in scheduler_origins
]
def test_maven_list_pom_multi_byte_encoding(swh_scheduler, requests_mock, datadir):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment