self = <swh.storage.tests.test_storage.TestStorage object at 0x7fbea06696d8>
swh_storage = <swh.storage.in_memory.InMemoryStorage object at 0x7fbea0664668>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7fbe83e4bfd0>
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])
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,
result[0],
result[1],
]:
dict_.pop(key, None)
expected_result = [expected_content, expected_duplicated_content]
for result in expected_result:
> assert result in result
E TypeError: unhashable type: 'dict'
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_storage.py:3082: TypeError
TEST RESULT
TEST RESULT
- Run At
- Jul 27 2020, 10:17 PM