self = <swh.storage.tests.test_storage.TestStorage object at 0x7fd8e392c470>
swh_storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7fd8e392c0f0>
def test_origin_visit_get__unknown_origin(self, swh_storage):
> assert [] == list(swh_storage.origin_visit_get("foo"))
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/test_storage.py:1616:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.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:930: in origin_visit_get
origin, last_visit=last_visit, limit=limit, cur=cur
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.storage.db.Db object at 0x7fd8e392c048>, origin_id = 'foo'
last_visit = None, limit = None
cur = <cursor object at 0x7fdab4ce19f8; closed: -1>
def origin_visit_get_all(self, origin_id, last_visit=None, limit=None, cur=None):
"""Retrieve all visits for origin with id origin_id.
Args:
origin_id: The occurrence's origin
Yields:
The occurrence's history visits
"""
cur = self._cursor(cur)
if last_visit:
extra_condition = "and visit > %s"
args = (origin_id, last_visit, limit)
else:
extra_condition = ""
args = (origin_id, limit)
query = """\
SELECT %s
FROM origin_visit
INNER JOIN origin ON origin.id = origin_visit.origin
WHERE origin.url=%%s %s
order by visit asc
limit %%s""" % (
", ".join(self.origin_visit_select_cols),
extra_condition,
)
> cur.execute(query, args)
E psycopg2.errors.UndefinedTable: relation "origin_visit" does not exist
E LINE 2: FROM origin_visit
E ^
.tox/py3/lib/python3.7/site-packages/swh/storage/db.py:548: UndefinedTable
TEST RESULT
TEST RESULT
- Run At
- Apr 21 2020, 12:34 PM