diff --git a/swh/storage/cassandra/storage.py b/swh/storage/cassandra/storage.py --- a/swh/storage/cassandra/storage.py +++ b/swh/storage/cassandra/storage.py @@ -285,7 +285,7 @@ yield content[key_hash] def content_missing_per_sha1(self, contents: List[bytes]) -> Iterable[bytes]: - return self.content_missing([{"sha1": c for c in contents}]) + return self.content_missing([{"sha1": c} for c in contents]) def content_missing_per_sha1_git( self, contents: List[Sha1Git] diff --git a/swh/storage/tests/test_storage.py b/swh/storage/tests/test_storage.py --- a/swh/storage/tests/test_storage.py +++ b/swh/storage/tests/test_storage.py @@ -509,13 +509,17 @@ def test_content_missing_per_sha1(self, swh_storage, sample_data): # given cont = sample_data.content + cont2 = sample_data.content2 missing_cont = sample_data.skipped_content - swh_storage.content_add([cont]) + missing_cont2 = sample_data.skipped_content2 + swh_storage.content_add([cont, cont2]) # when - gen = swh_storage.content_missing_per_sha1([cont.sha1, missing_cont.sha1]) + gen = swh_storage.content_missing_per_sha1( + [cont.sha1, missing_cont.sha1, cont2.sha1, missing_cont2.sha1] + ) # then - assert list(gen) == [missing_cont.sha1] + assert list(gen) == [missing_cont.sha1, missing_cont2.sha1] def test_content_missing_per_sha1_git(self, swh_storage, sample_data): cont, cont2 = sample_data.contents[:2]