diff --git a/swh/lister/bitbucket/tests/test_lister.py b/swh/lister/bitbucket/tests/test_lister.py --- a/swh/lister/bitbucket/tests/test_lister.py +++ b/swh/lister/bitbucket/tests/test_lister.py @@ -59,7 +59,7 @@ # First listing stats = lister.run() - scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).origins + scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results assert stats.pages == 2 assert stats.origins == 20 @@ -115,7 +115,7 @@ assert stats.pages == 2 assert stats.origins == 20 - assert len(swh_scheduler.get_listed_origins(lister.lister_obj.id).origins) == 20 + assert len(swh_scheduler.get_listed_origins(lister.lister_obj.id).results) == 20 def test_bitbucket_full_lister( @@ -165,7 +165,7 @@ assert stats.pages == 2 assert stats.origins == 20 - scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).origins + scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results # 20 because scheduler upserts based on (id, type, url) assert len(scheduler_origins) == 20 diff --git a/swh/lister/cgit/tests/test_lister.py b/swh/lister/cgit/tests/test_lister.py --- a/swh/lister/cgit/tests/test_lister.py +++ b/swh/lister/cgit/tests/test_lister.py @@ -51,7 +51,7 @@ # test page parsing scheduler_origins = swh_scheduler.get_listed_origins( lister_cgit.lister_obj.id - ).origins + ).results assert len(scheduler_origins) == expected_nb_origins # test listed repositories diff --git a/swh/lister/debian/tests/conftest.py b/swh/lister/debian/tests/conftest.py --- a/swh/lister/debian/tests/conftest.py +++ b/swh/lister/debian/tests/conftest.py @@ -9,7 +9,6 @@ from sqlalchemy.orm import sessionmaker from swh.core.db.pytest_plugin import postgresql_fact - from swh.lister.debian import debian_init import swh.scheduler diff --git a/swh/lister/gitea/tests/test_lister.py b/swh/lister/gitea/tests/test_lister.py --- a/swh/lister/gitea/tests/test_lister.py +++ b/swh/lister/gitea/tests/test_lister.py @@ -89,7 +89,7 @@ calls = [mocker.call(p1_result), mocker.call(p2_result)] lister.get_origins_from_page.assert_has_calls(calls) - scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).origins + scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results check_listed_origins(p1_origin_urls + p2_origin_urls, scheduler_origins) @@ -147,5 +147,5 @@ with pytest.raises(requests.HTTPError): lister.run() - scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).origins + scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results assert len(scheduler_origins) == 0 diff --git a/swh/lister/github/tests/test_lister.py b/swh/lister/github/tests/test_lister.py --- a/swh/lister/github/tests/test_lister.py +++ b/swh/lister/github/tests/test_lister.py @@ -88,8 +88,8 @@ origin_4321_req = swh_scheduler.get_listed_origins( url="https://github.com/origin/4321" ) - assert len(origin_4321_req.origins) == 1 - origin_4321 = origin_4321_req.origins[0] + assert len(origin_4321_req.results) == 1 + origin_4321 = origin_4321_req.results[0] assert origin_4321.lister_id == lister.id assert origin_4321.visit_type == "git" assert origin_4321.last_update == datetime.datetime( @@ -102,8 +102,8 @@ origin_5555_req = swh_scheduler.get_listed_origins( url="https://github.com/origin/5555" ) - assert len(origin_5555_req.origins) == 1 - origin_5555 = origin_5555_req.origins[0] + assert len(origin_5555_req.results) == 1 + origin_5555 = origin_5555_req.results[0] assert origin_5555.lister_id == lister.id assert origin_5555.visit_type == "git" assert origin_5555.last_update is None @@ -121,7 +121,7 @@ assert res == ListerStats(pages=NUM_PAGES, origins=ORIGIN_COUNT) listed_origins = swh_scheduler.get_listed_origins(limit=ORIGIN_COUNT + 1) - assert len(listed_origins.origins) == ORIGIN_COUNT + assert len(listed_origins.results) == ORIGIN_COUNT assert listed_origins.next_page_token is None lister_data = get_lister_data(swh_scheduler) @@ -152,7 +152,7 @@ assert res == ListerStats(pages=expected_pages, origins=expected_origins) listed_origins = swh_scheduler.get_listed_origins(limit=expected_origins + 1) - assert len(listed_origins.origins) == expected_origins + assert len(listed_origins.results) == expected_origins assert listed_origins.next_page_token is None lister_data = get_lister_data(swh_scheduler) diff --git a/swh/lister/gitlab/tests/test_lister.py b/swh/lister/gitlab/tests/test_lister.py --- a/swh/lister/gitlab/tests/test_lister.py +++ b/swh/lister/gitlab/tests/test_lister.py @@ -47,7 +47,7 @@ scheduler_origins = lister.scheduler.get_listed_origins( lister.lister_obj.id - ).origins + ).results assert len(scheduler_origins) == expected_nb_origins for listed_origin in scheduler_origins: @@ -88,7 +88,7 @@ scheduler_origins = lister.scheduler.get_listed_origins( lister.lister_obj.id - ).origins + ).results assert len(scheduler_origins) == expected_nb_origins for listed_origin in scheduler_origins: @@ -148,7 +148,7 @@ assert lister.lister_obj.id == lister2.lister_obj.id scheduler_origins = lister2.scheduler.get_listed_origins( lister2.lister_obj.id - ).origins + ).results assert len(scheduler_origins) == len(response1) + len(response2) + len(response3) diff --git a/swh/lister/npm/tests/test_lister.py b/swh/lister/npm/tests/test_lister.py --- a/swh/lister/npm/tests/test_lister.py +++ b/swh/lister/npm/tests/test_lister.py @@ -92,7 +92,7 @@ ] ) - scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).origins + scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results _check_listed_npm_packages( lister, @@ -154,7 +154,7 @@ ] ) - scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).origins + scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results _check_listed_npm_packages( lister, diff --git a/swh/lister/phabricator/tests/test_lister.py b/swh/lister/phabricator/tests/test_lister.py --- a/swh/lister/phabricator/tests/test_lister.py +++ b/swh/lister/phabricator/tests/test_lister.py @@ -109,7 +109,7 @@ assert stats.pages == 2 assert stats.origins == expected_nb_origins - scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).origins + scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results assert len(scheduler_origins) == expected_nb_origins diff --git a/swh/lister/pypi/tests/test_lister.py b/swh/lister/pypi/tests/test_lister.py --- a/swh/lister/pypi/tests/test_lister.py +++ b/swh/lister/pypi/tests/test_lister.py @@ -46,7 +46,7 @@ stats = lister.run() - scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).origins + scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results lister.session.get.assert_called_once_with(lister.PACKAGE_LIST_URL) lister.get_origins_from_page.assert_called_once_with(t_names) @@ -76,5 +76,5 @@ lister.session.get.assert_called_once_with(lister.PACKAGE_LIST_URL) - scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).origins + scheduler_origins = swh_scheduler.get_listed_origins(lister.lister_obj.id).results assert len(scheduler_origins) == 0 diff --git a/swh/lister/tests/test_pattern.py b/swh/lister/tests/test_pattern.py --- a/swh/lister/tests/test_pattern.py +++ b/swh/lister/tests/test_pattern.py @@ -93,9 +93,9 @@ # And check the state of origins in the scheduler ret = swh_scheduler.get_listed_origins() assert ret.next_page_token is None - assert len(ret.origins) == len(lister_urls) + assert len(ret.results) == len(lister_urls) - for origin, expected_url in zip(ret.origins, lister_urls): + for origin, expected_url in zip(ret.results, lister_urls): assert origin.url == expected_url assert origin.lister_id == stored_lister.id