self = <swh.storage.tests.test_cassandra.TestCassandraStorage object at 0x7fbff465cb38>
swh_storage = <swh.storage.cassandra.storage.CassandraStorage object at 0x7fbff40c4438>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7fbfac680630>
def test_content_find_with_duplicate_blake2s256(self, swh_storage, sample_data):
content = sample_data.content
# Create fake data with colliding sha256 and blake2s256
sha1_array = bytearray(content.sha1)
sha1_array[0] += 1
sha1git_array = bytearray(content.sha1_git)
sha1git_array[0] += 1
sha256_array = bytearray(content.sha256)
sha256_array[0] += 1
duplicated_content = attr.evolve(
content,
sha1=bytes(sha1_array),
sha1_git=bytes(sha1git_array),
sha256=bytes(sha256_array),
)
swh_storage.content_add([content, duplicated_content])
actual_result = list(
swh_storage.content_find({"blake2s256": duplicated_content.blake2s256})
)
expected_content = content.to_dict()
expected_duplicated_content = duplicated_content.to_dict()
for key in ["data", "ctime"]: # so we can compare
for dict_ in [
expected_content,
expected_duplicated_content,
actual_result[0],
actual_result[1],
]:
dict_.pop(key, None)
expected_result = [expected_content, expected_duplicated_content]
for actual_result in expected_result:
> assert actual_result in actual_result
E TypeError: unhashable type: 'dict'
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_storage.py:3086: TypeError
TEST RESULT
TEST RESULT
- Run At
- Jul 27 2020, 10:24 PM