swh_storage = <swh.storage.proxies.retry.RetryingProxyStorage object at 0x7fcfdfa11a20>
requests_mock_datadir = <requests_mock.mocker.Mocker object at 0x7fcfddf28f60>
requests_mock = <requests_mock.mocker.Mocker object at 0x7fcfddf28f60>
data_jar_2 = b'PK\x03\x04\n\x00\x00\x08\x08\x00\xd7|\xb7L\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00META-INF/\x0...+\x00\x00al/aldi/sprova4j/models/Execution.javaPK\x05\x06\x00\x00\x00\x00#\x00#\x00\xe2\n\x00\x00\xb6-\x00\x00\x00\x00'
def test_jar_2_visits_without_change(
swh_storage, requests_mock_datadir, requests_mock, data_jar_2
):
"""With no prior visit, load a gnu project ends up with 1 snapshot
"""
requests_mock.get(MVN_ARTIFACTS[1]["url"], content=data_jar_2)
loader = JarLoader(
swh_storage, MVN_ARTIFACTS[1]["url"], artifacts=[MVN_ARTIFACTS[1]]
)
actual_load_status = loader.load()
print(f"Debug test 2 actual_snapshot is {actual_load_status['snapshot_id']}.")
assert actual_load_status["status"] == "eventful"
expected_snapshot_first_visit_id = hash_to_bytes(
"5da7a3cc23230c9d1be27395a2ab483e8d01ae19"
)
> assert (
hash_to_bytes(actual_load_status["snapshot_id"])
== expected_snapshot_first_visit_id
)
E AssertionError: assert b'\xe0\x85\xb...x93\x17?\xcf ' == b']\xa7\xa3\x...d\x01\xae\x19'
E At index 0 diff: b'\xe0' != b']'
E Full diff:
E - b']\xa7\xa3\xcc##\x0c\x9d\x1b\xe2s\x95\xa2\xabH>\x8d\x01\xae\x19'
E + b'\xe0\x85\xb3\xb8\xb2\x1bZ\xca\x02\x9a\x8fO\xab\xc6X\x93\x17?\xcf '
.tox/py3/lib/python3.7/site-packages/swh/loader/package/jar/tests/test_jar.py:240: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Sep 3 2021, 3:48 PM