self = <swh.storage.tests.test_storage.TestStorage object at 0x7f469c5a19b0>
swh_storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7f469c5a1320>
def test_skipped_content_add_missing_hashes(self, swh_storage):
cont = data.skipped_cont
cont2 = data.skipped_cont2
cont["sha1_git"] = cont2["sha1_git"] = None
> missing = list(swh_storage.skipped_content_missing([cont, cont2]))
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_storage.py:476:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/core/db/common.py:97: in _meth
yield from meth(self, *args, db=db, cur=cur, **kwargs)
.tox/py3/lib/python3.7/site-packages/swh/storage/storage.py:448: in skipped_content_missing
for content in db.skipped_content_missing(contents, cur):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.db.Db object at 0x7f45c086be48>
contents = [{'blake2s256': b'\xad\xe1\x8b\x1a\xde\xcb3\xf8\x91\xca6fM\xa6v\xe1,w,\xc1\x93w\x8a\xac\x9a\x13{\x8d\xc5\x83K\x9b', 'l...0, 'reason': 'Content too long', 'sha1': b'T\xe4]V\xf8\x89\x93\xaa\xe6\xa0\x19\x80\x13\xef\xa8\x07\x16\xfd\x89 ', ...}]
cur = <cursor object at 0x7f478e6b19f8; closed: -1>
def skipped_content_missing(self, contents, cur=None):
if not contents:
return []
cur = self._cursor(cur)
query = """SELECT * FROM (VALUES %s) AS t (%s)
WHERE not exists
(SELECT 1 FROM skipped_content s WHERE
s.sha1 is not distinct from t.sha1::sha1 and
s.sha1_git is not distinct from t.sha1_git::sha1 and
s.sha256 is not distinct from t.sha256::bytea);""" % (
(", ".join("%s" for _ in contents)),
", ".join(self.content_hash_keys),
)
cur.execute(
query,
> [tuple(cont[key] for key in self.content_hash_keys) for cont in contents],
)
E psycopg2.errors.UndefinedTable: relation "skipped_content" does not exist
E LINE 3: (SELECT 1 FROM skipped_content s WHERE
E ^
.tox/py3/lib/python3.7/site-packages/swh/storage/db.py:192: UndefinedTable
TEST RESULT
TEST RESULT
- Run At
- May 20 2020, 9:28 AM