swh_storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7fa36c61e908>
def test_origin_get_latest_visit_status_filter_snapshot(swh_storage):
objects = init_storage_with_origin_visits(swh_storage)
origin1, origin2 = objects["origin"]
_, ov2 = objects["origin_visit"]
_, _, _, ovs22 = objects["origin_visit_status"]
# there is no visit with snapshot yet for that visit
assert (
origin_get_latest_visit_status(swh_storage, origin1.url, require_snapshot=True)
is None
)
# visit status with partial status visit elected
actual_ov2, actual_ovs22 = origin_get_latest_visit_status(
swh_storage, origin2.url, require_snapshot=True
)
assert actual_ov2.origin == ov2.origin
assert actual_ov2.visit == ov2.visit
assert actual_ov2.type == ov2.type
assert actual_ovs22 == ovs22
date_now = now()
# Add another visit
swh_storage.origin_visit_add(
[
OriginVisit(
origin=origin2.url,
date=date_now,
type=data.type_visit2,
status="ongoing",
snapshot=None,
),
]
)
# Requiring the latest visit with a snapshot, we still find the previous visit
ov2, ovs22 = origin_get_latest_visit_status(
swh_storage, origin2.url, require_snapshot=True
)
assert actual_ov2.origin == ov2.origin
assert actual_ov2.visit == ov2.visit
assert actual_ov2.type == ov2.type
assert actual_ovs22 == ovs22
ov2, ovs22 = origin_get_latest_visit_status(
> swh_storage, origin2.url, require_snapshot=True, limit=1
)
E TypeError: cannot unpack non-iterable NoneType object
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/algos/test_origin.py:338: TypeError
TEST RESULT
TEST RESULT
- Run At
- Jun 24 2020, 6:17 PM