live_server = <[AttributeError("'LiveServer' object has no attribute 'url'") raised in repr()] LiveServer object at 0x7f4e1eb70a20>
aiosession = <aiohttp.client.ClientSession object at 0x7f4e1eaf8cf8>
event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
source_tree_policy = Directory(id=fe8cd7076bef324eb8865f818ef08617879022ce, entries=[b'some-binary', b'foo', b'toexclude', b'bar'])
tmp_requests = local('/tmp/pytest-of-jenkins/pytest-0/data0/requests.json')
def test_file_priority_policy(
live_server, aiosession, event_loop, source_tree_policy, tmp_requests
):
open(tmp_requests, "w").close()
api_url = url_for("index", _external=True)
nodes_data = MerkleNodeInfo()
policy = FilePriority(source_tree_policy, nodes_data)
event_loop.run_until_complete(policy.run(aiosession, api_url))
expected_order = [
"swh:1:cnt:7c4c57ba9ff496ad179b8f65b1d286edbda34c9a",
"swh:1:cnt:5f1cfce26640056bed3710cfaf3062a6a326a119",
"swh:1:cnt:620d4582bfbf773ef15f9b52ac434906a3cdf9c3",
"swh:1:cnt:133693b125bad2b4ac318535b84901ebb1f6b638",
"swh:1:cnt:68769579c3eaadbe555379b9c3538e6628bae1eb",
"swh:1:dir:1bfb212e59d0c6d569a94557e3ad9acce73f8357",
"swh:1:dir:a2292f6ce96ad1f8c05d8e6c47a3f5579fd7af94",
]
> assert get_backend_swhids_order(tmp_requests) == expected_order
E AssertionError: assert ['swh:1:cnt:1...fd7af94', ...] == ['swh:1:cnt:7...73f8357', ...]
E At index 0 diff: 'swh:1:cnt:133693b125bad2b4ac318535b84901ebb1f6b638' != 'swh:1:cnt:7c4c57ba9ff496ad179b8f65b1d286edbda34c9a'
E Full diff:
E [
E + 'swh:1:cnt:133693b125bad2b4ac318535b84901ebb1f6b638',
E + 'swh:1:cnt:620d4582bfbf773ef15f9b52ac434906a3cdf9c3',
E + 'swh:1:cnt:5f1cfce26640056bed3710cfaf3062a6a326a119',
E 'swh:1:cnt:7c4c57ba9ff496ad179b8f65b1d286edbda34c9a',...
E
E ...Full output truncated (9 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/scanner/tests/test_policy.py:144: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jul 20 2021, 4:26 PM