swh_storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7f384d9249e8>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f384d924470>
def test_validating_proxy_storage_directory(swh_storage, sample_data):
sample_directory = sample_data.directory
id_ = hash_to_hex(sample_directory.id)
assert swh_storage.directory_missing([sample_directory.id]) == [sample_directory.id]
with pytest.raises(StorageArgumentException, match=f"should be {id_}"):
s = swh_storage.directory_add([attr.evolve(sample_directory, id=b"a" * 20)])
assert swh_storage.directory_missing([sample_directory.id]) == [sample_directory.id]
> s = swh_storage.directory_add([sample_directory])
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_validate.py:73:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/storage/validate.py:59: in directory_add
return self.storage.directory_add(directories)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7f384d924f98>
directories = [Directory(entries=(DirectoryEntry(name=b'foo', type='file', target=b'\xd8\x1c\xc0q\x0e\xb6\xcf\x9e\xfd[\x92\n\x84S\xe...x04', perms=<DentryPerms.directory: 16384>)), id=b'RV\xe8V\xa0\xa0\x89\x89f\xd6\xba\x14\xfe\xb48\x8b\x8b\x82\xd3\x02')]
def directory_add(self, directories: List[Directory]) -> Dict:
to_add = {d.id: d for d in directories}.values()
> if not self._allow_overwrite:
E AttributeError: 'InMemoryStorage' object has no attribute '_allow_overwrite'
.tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:400: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Apr 29 2021, 10:23 AM