Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/tests/test_journal_client.py
# Copyright (C) 2021 The Software Heritage developers | # Copyright (C) 2021-2022 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import datetime | import datetime | ||||
import functools | import functools | ||||
from itertools import permutations | from itertools import permutations | ||||
from typing import List | from typing import List | ||||
▲ Show 20 Lines • Show All 988 Lines • ▼ Show 20 Lines | assert_visit_stats_ok( | ||||
last_visit=DATE3, | last_visit=DATE3, | ||||
last_visit_status=LastVisitStatus.failed, | last_visit_status=LastVisitStatus.failed, | ||||
next_position_offset=6, | next_position_offset=6, | ||||
successive_visits=3, | successive_visits=3, | ||||
), | ), | ||||
) | ) | ||||
# Now check that the origin in question is disabled | # Now check that the origin in question is disabled | ||||
actual_page = swh_scheduler.get_listed_origins(url="bar") | actual_page = swh_scheduler.get_listed_origins(url="bar", enabled=False) | ||||
assert len(actual_page.results) == 1 | assert len(actual_page.results) == 1 | ||||
assert actual_page.next_page_token is None | assert actual_page.next_page_token is None | ||||
for origin in actual_page.results: | for origin in actual_page.results: | ||||
assert origin.enabled is False | assert origin.enabled is False | ||||
assert origin.lister_id == lister.id | assert origin.lister_id == lister.id | ||||
assert origin.url == "bar" | assert origin.url == "bar" | ||||
assert origin.visit_type == "svn" | assert origin.visit_type == "svn" |