Changeset View
Changeset View
Standalone View
Standalone View
swh/lister/launchpad/tests/test_lister.py
# Copyright (C) 2020 The Software Heritage developers | # Copyright (C) 2020 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 | ||||
def test_launchpad_lister(lister_launchpad, datadir): | def test_launchpad_lister(initialized_lister, datadir): | ||||
lister_launchpad.run() | initialized_lister.run() | ||||
assert ( | assert ( | ||||
len(lister_launchpad.launchpad.git_repositories.getRepositories.mock_calls) == 3 | len(initialized_lister.launchpad.git_repositories.getRepositories.mock_calls) | ||||
== 3 | |||||
) | ) | ||||
r = lister_launchpad.scheduler.search_tasks(task_type="load-git") | r = initialized_lister.scheduler.search_tasks(task_type="load-git") | ||||
assert len(r) == 30 | assert len(r) == 30 | ||||
for row in r: | for row in r: | ||||
assert row["type"] == "load-git" | assert row["type"] == "load-git" | ||||
# arguments check | # arguments check | ||||
args = row["arguments"]["args"] | args = row["arguments"]["args"] | ||||
assert len(args) == 0 | assert len(args) == 0 | ||||
Show All 10 Lines |