self = <swh.storage.tests.test_in_memory.TestInMemoryStorage object at 0x7f38580b08d0>
swh_storage = <swh.storage.in_memory.InMemoryStorage object at 0x7f3856769c18>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f386e0dfda0>
def test_extid_add_hg(self, swh_storage, sample_data):
def get_node(revision):
node = None
if revision.extra_headers:
node = dict(revision.extra_headers).get(b"node")
if node is None and revision.metadata:
node = hash_to_bytes(revision.metadata.get("node"))
return node
swhids = [
revision.id
for revision in sample_data.revisions
if revision.type.value == "hg"
]
extids = [
get_node(revision)
for revision in sample_data.revisions
if revision.type.value == "hg"
]
assert swh_storage.extid_get_from_extid("hg", extids) == []
assert swh_storage.extid_get_from_target(ObjectType.REVISION, swhids) == []
extid_objs = [
ExtID(
extid=hgid,
extid_type="hg",
target=CoreSWHID(object_id=swhid, object_type=ObjectType.REVISION,),
)
for hgid, swhid in zip(extids, swhids)
]
> summary = swh_storage.extid_add(extid_objs)
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/storage_tests.py:1153:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7f3856769c18>
ids = [ExtID(extid_type='hg', extid=b'\xa3\x16\xdf\xb44\xaf+E\x1c\x1f94\x96\xb7\xea\xed\xa3C\xf5C', target=CoreSWHID(namespa...object_type=<ObjectType.REVISION: 'rev'>), id=b'\x07Z\xc0\xa5\x85\xc1\xac\xc5\xb6\x02\x1b\xc0\xfc\xe2\xa1r\x8e\x01mm')]
def extid_add(self, ids: List[ExtID]) -> Dict[str, int]:
> 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:1389: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Apr 29 2021, 10:23 AM