self = <swh.storage.tests.test_in_memory.TestInMemoryStorage object at 0x7f6058313278>
swh_storage = <swh.storage.in_memory.InMemoryStorage object at 0x7f6058b6d390>
sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f6247744438>
def test_extid_add_git(self, swh_storage, sample_data):
gitids = [
revision.id
for revision in sample_data.revisions
if revision.type.value == "git"
]
extids = [
ExtID(
extid=gitid,
extid_type="git",
target=CoreSWHID(object_id=gitid, object_type=ObjectType.REVISION,),
)
for gitid in gitids
]
assert swh_storage.extid_get_from_extid("git", gitids) == []
assert swh_storage.extid_get_from_target(ObjectType.REVISION, gitids) == []
> summary = swh_storage.extid_add(extids)
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/storage_tests.py:1105:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.in_memory.InMemoryStorage object at 0x7f6058b6d390>
ids = [ExtID(extid_type='git', extid=b'\x01\xa7\x11O6\xfd\xdd^\xf2Q\x1b,\xad\xda#zh\xad\xbb\x12', target=CoreSWHID(namespace...S]\xfe', object_type=<ObjectType.REVISION: 'rev'>), id=b'\x06\xf0p\xa5\xbd\xd6v-\x1ft\xf8\xf4);\xba\x0b\xe9*\xb3\xeb')]
def extid_add(self, ids: List[ExtID]) -> Dict[str, int]:
if not self._allow_overwrite:
extids = [
extid
for extid in ids
if not self._cql_runner.extid_get_from_pk(
extid_type=extid.extid_type, extid=extid.extid, target=extid.target,
)
]
> self.journal_writer.extid_add(extids)
E UnboundLocalError: local variable 'extids' referenced before assignment
.tox/py3/lib/python3.7/site-packages/swh/storage/cassandra/storage.py:1398: UnboundLocalError
TEST RESULT
TEST RESULT
- Run At
- Apr 29 2021, 11:06 AM