swh_storage = <swh.storage.retry.RetryingProxyStorage object at 0x7fd49b037ef0>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7fd49b037390>
def test_retrying_proxy_storage_content_add_metadata(swh_storage, sample_data):
"""Standard content_add_metadata works as before
"""
sample_content = sample_data.content
content = attr.evolve(sample_content, data=None)
pk = content.sha1
content_metadata = swh_storage.content_get_metadata([pk])
assert not content_metadata[pk]
s = swh_storage.content_add_metadata([content])
assert s == {
"content:add": 1,
}
> content_metadata = swh_storage.content_get_metadata([pk])
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_retry.py:128:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7fd49b037da0>
contents = [b'4\x972t\xcc\xefj\xb4\xdf\xaa\xf8e\x99y/\xa9\xc3\xfeF\x89']
def content_get_metadata(self, contents: List[bytes]) -> Dict[bytes, List[Dict]]:
result: Dict = {sha1: [] for sha1 in contents}
for sha1 in contents:
if sha1 in self._content_indexes["sha1"]:
objs = self._content_indexes["sha1"][sha1]
# only 1 element as content_add_metadata would have raised a
# hash collision otherwise
for key in objs:
d = self._contents[key].to_dict()
> del d["ctime"]
E KeyError: 'ctime'
.tox/py3/lib/python3.7/site-packages/swh/storage/in_memory.py:306: KeyError
TEST RESULT
TEST RESULT
- Run At
- Aug 7 2020, 11:38 AM