live_server = <[AttributeError("'LiveServer' object has no attribute 'url'") raised in repr()] LiveServer object at 0x7f91f360abe0>
aiosession = <aiohttp.client.ClientSession object at 0x7f920dd4d550>
event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
source_tree = Directory(id=0a7b61ef5780b03aa274d11069564980246445ce, entries=[b'some-binary', b'link-to-another-quote', b'foo', b'toexclude', b'bar', b'link-to-foo'])
tmp_requests = local('/tmp/pytest-of-jenkins/pytest-0/data0/requests.json')
def test_directory_priority_policy(
live_server, aiosession, event_loop, source_tree, tmp_requests
):
open(tmp_requests, "w").close()
api_url = url_for("index", _external=True)
nodes_data = MerkleNodeInfo()
policy = DirectoryPriority(source_tree, nodes_data)
event_loop.run_until_complete(policy.run(aiosession, api_url))
expected_order = [
"swh:1:dir:2b41c40f0d1fbffcba12497db71fba83fcca96e5",
"swh:1:dir:07d4d9ec5c406632d203dbd4631e7863612a0326",
"swh:1:dir:9619a28687b2462efbb5be816bc1185b95753d93",
"swh:1:dir:c3020f6bf135a38c6df3afeb5fb38232c5e07087",
"swh:1:dir:1bfb212e59d0c6d569a94557e3ad9acce73f8357",
"swh:1:cnt:7d5c08111e21c8a9f71540939998551683375fad",
"swh:1:cnt:68769579c3eaadbe555379b9c3538e6628bae1eb",
"swh:1:cnt:5f1cfce26640056bed3710cfaf3062a6a326a119",
"swh:1:cnt:19102815663d23f8b75a47e7a01965dcdc96468c",
]
> assert get_backend_swhids_order(tmp_requests) == expected_order
E AssertionError: assert ['swh:1:dir:c...8bae1eb', ...] == ['swh:1:dir:2...3375fad', ...]
E At index 0 diff: 'swh:1:dir:c3020f6bf135a38c6df3afeb5fb38232c5e07087' != 'swh:1:dir:2b41c40f0d1fbffcba12497db71fba83fcca96e5'
E Full diff:
E [
E + 'swh:1:dir:c3020f6bf135a38c6df3afeb5fb38232c5e07087',
E + 'swh:1:dir:9619a28687b2462efbb5be816bc1185b95753d93',
E + 'swh:1:dir:07d4d9ec5c406632d203dbd4631e7863612a0326',
E 'swh:1:dir:2b41c40f0d1fbffcba12497db71fba83fcca96e5',...
E
E ...Full output truncated (11 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/scanner/tests/test_policy.py:120: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jul 20 2021, 3:58 PM