self = <swh.storage.tests.test_tenacious.TestTenaciousStorage object at 0x7fef7d106550>
swh_storage = <swh.storage.proxies.tenacious.TenaciousProxyStorage object at 0x7fef7d106080>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7fef7d106c50>
def test_content_missing_per_sha1_git(self, swh_storage, sample_data):
cont, cont2 = sample_data.contents[:2]
missing_cont = sample_data.skipped_content
missing_cont2 = sample_data.skipped_content2
swh_storage.content_add([cont, cont2])
contents = [
cont.sha1_git,
cont2.sha1_git,
missing_cont.sha1_git,
missing_cont2.sha1_git,
]
missing_contents = swh_storage.content_missing_per_sha1_git(contents)
> assert list(missing_contents) == [missing_cont.sha1_git, missing_cont2.sha1_git]
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/storage_tests.py:558:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7fef7d1066a0>
contents = [{'sha1_git': b'\xd8\x1c\xc0q\x0e\xb6\xcf\x9e\xfd[\x92\n\x84S\xe1\xe0qW\xb6\xcd'}, {'sha1_git': b'6\xfa\xdew\x19<\xb6\...\x13\xef\xa8\x07\x16\xfd\x89 '}, {'sha1_git': b'D\xe4]V\xf8\x89\x93\xaa\xe6\xa0\x19\x80\x13\xef\xa8\x07\x16\xfd\x89!'}]
key_hash = 'sha1_git'
@timed
def content_missing(
self, contents: List[Dict[str, Any]], key_hash: str = "sha1"
) -> Iterable[bytes]:
if key_hash not in DEFAULT_ALGORITHMS:
raise StorageArgumentException(
"key_hash should be one of {','.join(DEFAULT_ALGORITHMS)}"
)
contents_with_all_hashes = []
contents_with_missing_hashes = []
for content in contents:
if DEFAULT_ALGORITHMS <= set(content):
contents_with_all_hashes.append(content)
else:
contents_with_missing_hashes.append(content)
# These contents can be queried efficiently directly in the main table
> for content in self._cql_runner.content_missing_from_all_hashes(
contents_with_all_hashes
):
E AttributeError: 'InMemoryCqlRunner' object has no attribute 'content_missing_from_all_hashes'
.tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:406: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Jan 6 2022, 5:39 PM