Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_in_memory.TestInMemoryStorage::test_extid_add_hg
Failed

TEST RESULT

Run At
Apr 29 2021, 11:06 AM
Details
self = <swh.storage.tests.test_in_memory.TestInMemoryStorage object at 0x7f6081fafc50> swh_storage = <swh.storage.in_memory.InMemoryStorage object at 0x7f605724fac8> sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f60582c1438> 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 0x7f605724fac8> 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: 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