content = {'blake2s256': '390cd78a6461faf060de75f92c60f2f061f5bde15fce5c3b5c66d9f5e0fab203', 'data': '.hljs{display:block;overfl...avascript,.xml .vbscript,.xml .css,.xml .hljs-cdata{opacity:0.5}', 'encoding': 'us-ascii', 'hljs_language': 'css', ...}
directory = '0c538a4e9309aedaa83c6f4e3a19017edb758e73'
def test_lookup_missing_hashes_some_present(content, directory):
missing_rev = random_sha1_bytes()
missing_rel = random_sha1_bytes()
missing_snp = random_sha1_bytes()
grouped_swhids = {
ObjectType.CONTENT: [hash_to_bytes(content["sha1_git"])],
ObjectType.DIRECTORY: [hash_to_bytes(directory)],
ObjectType.REVISION: [missing_rev],
ObjectType.RELEASE: [missing_rel],
ObjectType.SNAPSHOT: [missing_snp],
}
actual_result = archive.lookup_missing_hashes(grouped_swhids)
> assert actual_result == {
ObjectType.REVISION: {missing_rev},
ObjectType.RELEASE: {missing_rel},
ObjectType.SNAPSHOT: {missing_snp},
}
E assert {<ObjectType....17\xf3'}, ...} == {<ObjectType....1e%\xa5\x98'}}
E Omitting 3 identical items, use -vv to show
E Left contains 2 more items:
E {<ObjectType.DIRECTORY: 'dir'>: set(), <ObjectType.CONTENT: 'cnt'>: set()}
E Full diff:
E {
E <ObjectType.REVISION: 'rev'>: {b'D"W+\xd6\xad,\x9c\xc2\xbc\x85\xc1\xc0%/-'
E b'8U\xfa\xc9'},...
E
E ...Full output truncated (8 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/web/tests/common/test_archive.py:984: AssertionError
TEST RESULT
TEST RESULT
- Run At
- May 7 2022, 7:43 PM