swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f4f1a7f2b38>
def test_journal_client_origin_visit_status_from_journal_last_eventful(swh_scheduler):
visit_statuses = [
{
"origin": "bar",
"visit": 1,
"status": "partial",
"date": utcnow(),
"type": "git",
"snapshot": hash_to_bytes("d81cc0710eb6cf9efd5b920a8453e1e07157b6cd"),
},
{
"origin": "foo",
"visit": 1,
"status": "full",
"date": DATE1,
"type": "git",
"snapshot": hash_to_bytes("eeecc0710eb6cf9efd5b920a8453e1e07157bfff"),
},
{
"origin": "foo",
"visit": 2,
"status": "partial",
"date": DATE2,
"type": "git",
"snapshot": hash_to_bytes("aaacc0710eb6cf9efd5b920a8453e1e07157baaa"),
},
{
"origin": "foo",
"visit": 3,
"status": "full",
"date": DATE3,
"type": "git",
"snapshot": hash_to_bytes("dddcc0710eb6cf9efd5b920a8453e1e07157bddd"),
},
]
process_journal_objects(
{"origin_visit_status": visit_statuses}, scheduler=swh_scheduler
)
actual_origin_visit_stats = swh_scheduler.origin_visit_stats_get([("foo", "git")])
> assert actual_origin_visit_stats == [
OriginVisitStats(
url="foo",
visit_type="git",
last_eventful=DATE3,
last_uneventful=None,
last_failed=None,
last_notfound=None,
last_snapshot=hash_to_bytes("dddcc0710eb6cf9efd5b920a8453e1e07157bddd"),
next_visit_queue_position=None,
next_position_offset=0,
)
]
E AssertionError: assert [OriginVisitS...ion_offset=0)] == [OriginVisitS...ion_offset=0)]
E At index 0 diff: OriginVisitStats(url='foo', visit_type='git', last_eventful=datetime.datetime(2021, 6, 30, 8, 7, 44, 578859, tzinfo=datetime.timezone.utc), last_uneventful=None, last_failed=None, last_notfound=None, last_scheduled=None, last_snapshot=b'\xdd\xdc\xc0q\x0e\xb6\xcf\x9e\xfd[\x92\n\x84S\xe1\xe0qW\xbd\xdd', next_visit_queue_position=datetime.datetime(2021, 7, 5, 5, 44, 43, 147921, tzinfo=datetime.timezone.utc), next_position_offset=0) != OriginVisitStats(url='foo', visit_type='git', last_eventful=datetime.datetime(2021, 6, 30, 8, 7, 44, 578859, tzinfo=datetim...
E
E ...Full output truncated (6 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/scheduler/tests/test_journal_client.py:335: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jun 30 2021, 10:09 AM