self = <swh.storage.tests.test_tenacious.TestTenaciousStorage object at 0x7f003b985a90>
swh_storage = <swh.storage.proxies.tenacious.TenaciousProxyStorage object at 0x7f003b985550>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f001a8d4550>
@pytest.mark.property_based
> @settings(suppress_health_check=function_scoped_fixture_check,)
@given(
strategies.sets(
elements=strategies.sampled_from(["sha256", "sha1_git", "blake2s256"]),
min_size=0,
)
)
def test_content_missing_unknown_algo(self, swh_storage, sample_data, algos):
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/storage_tests.py:494:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.tests.test_tenacious.TestTenaciousStorage object at 0x7f003b985a90>
swh_storage = <swh.storage.proxies.tenacious.TenaciousProxyStorage object at 0x7f003b985550>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f001a8d4550>
algos = {'sha1'}
@pytest.mark.property_based
@settings(suppress_health_check=function_scoped_fixture_check,)
@given(
strategies.sets(
elements=strategies.sampled_from(["sha256", "sha1_git", "blake2s256"]),
min_size=0,
)
)
def test_content_missing_unknown_algo(self, swh_storage, sample_data, algos):
algos |= {"sha1"}
content, missing_content = [sample_data.content2, sample_data.skipped_content]
swh_storage.content_add([content])
test_contents = [content.to_dict()]
missing_per_hash = defaultdict(list)
for i in range(16):
test_content = missing_content.to_dict()
for hash in algos:
test_content[hash] = bytes([i]) + test_content[hash][1:]
missing_per_hash[hash].append(test_content[hash])
test_content["nonexisting_algo"] = b"\x00"
test_contents.append(test_content)
> assert set(swh_storage.content_missing(test_contents)) == set(
missing_per_hash["sha1"]
)
E AssertionError: assert {b'\x00\xe4]V...fd\x89 ', ...} == {b'\x00\xe4]V...fd\x89 ', ...}
E Extra items in the left set:
E b'a\xc2\xb3\xa3\x04\x96\xd3)\xe2\x1a\xf7\r\xd2\xd7\xe0\x97\x04m\x07\xb7'
E Full diff:
E {
E b'\x00\xe4]V\xf8\x89\x93\xaa\xe6\xa0\x19\x80\x13\xef\xa8\x07\x16\xfd\x89 ',
E b'\x01\xe4]V\xf8\x89\x93\xaa\xe6\xa0\x19\x80\x13\xef\xa8\x07\x16\xfd\x89 ',
E b'\x02\xe4]V\xf8\x89\x93\xaa\xe6\xa0\x19\x80\x13\xef\xa8\x07\x16\xfd\x89 ',...
E
E ...Full output truncated (16 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/storage_tests.py:516: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Sep 15 2021, 3:20 PM