swh_storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7f3865aa87b8>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f3858907a90>
def test_validating_proxy_storage_snapshot(swh_storage, sample_data):
sample_snapshot = sample_data.snapshot
id_ = hash_to_hex(sample_snapshot.id)
assert swh_storage.snapshot_missing([sample_snapshot.id]) == [sample_snapshot.id]
with pytest.raises(StorageArgumentException, match=f"should be {id_}"):
s = swh_storage.snapshot_add([attr.evolve(sample_snapshot, id=b"a" * 20)])
assert swh_storage.snapshot_missing([sample_snapshot.id]) == [sample_snapshot.id]
> s = swh_storage.snapshot_add([sample_snapshot])
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_validate.py:130:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/storage/validate.py:71: in snapshot_add
return self.storage.snapshot_add(snapshots)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7f3865aa84a8>
snapshots = [Snapshot(branches=ImmutableDict({b'master': SnapshotBranch(target=b'\x01\xa7\x11O6\xfd\xdd^\xf2Q\x1b,\xad\xda#zh\xad\...12', target_type=<TargetType.REVISION: 'revision'>)}), id=b'\x9b\x92.m\x8d[\x80<\x15\x82\xaa\xbeU%\xb7\xb9\x11Px\x8e')]
def snapshot_add(self, snapshots: List[Snapshot]) -> Dict:
> 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:668: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Apr 29 2021, 10:23 AM