swh_storage = <swh.storage.retry.RetryingProxyStorage object at 0x7f1778687860>
sample_data_model = {'authority': [MetadataAuthority(type=<MetadataAuthorityType.DEPOSIT_CLIENT: 'deposit_client'>, url='http://hal.inria....11', length=7, status='visible', data=b'424242\n', ctime=datetime.datetime(2019, 12, 1, 0, 0, tzinfo=tzlocal()))], ...}
mocker = <pytest_mock.plugin.MockFixture object at 0x7f177e1b0ef0>
def test_retrying_proxy_swh_storage_object_metadata_add_failure(
swh_storage, sample_data_model, mocker
):
"""Unfiltered errors are raising without retry
"""
mock_memory = mocker.patch(
"swh.storage.in_memory.InMemoryStorage.object_metadata_add"
)
mock_memory.side_effect = StorageArgumentException("Refuse to add always!")
ori_meta = sample_data_model["origin_metadata"][0]
> swh_storage.origin_add([{"url": ori_meta.id}])
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_retry.py:548:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7f1778687fd0>
origins = [{'url': 'file:///dev/null'}]
def origin_add(self, origins: Iterable[Origin]) -> Dict[str, int]:
origins = list(origins)
added = 0
for origin in origins:
> if origin.url not in self._origins:
E AttributeError: 'dict' object has no attribute 'url'
.tox/py3/lib/python3.7/site-packages/swh/storage/in_memory.py:782: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Jul 21 2020, 9:55 AM