From df2754e5a68150cff225e072c62d19025d647dec Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont (@ardumont)" Date: Tue, 18 Jun 2019 14:12:55 +0200 Subject: [PATCH] phabricator.tasks: Remove unused code Related T1824 Related P438 --- swh/lister/phabricator/tasks.py | 6 ------ swh/lister/phabricator/tests/test_tasks.py | 22 ---------------------- 2 files changed, 28 deletions(-) diff --git a/swh/lister/phabricator/tasks.py b/swh/lister/phabricator/tasks.py index ce37fa4..5ec794d 100644 --- a/swh/lister/phabricator/tasks.py +++ b/swh/lister/phabricator/tasks.py @@ -12,12 +12,6 @@ def new_lister(forge_url='https://forge.softwareheritage.org', instance='swh', forge_url=forge_url, instance=instance, api_token=api_token, **kw) -@app.task(name=__name__ + '.IncrementalPhabricatorLister') -def incremental_phabricator_lister(**lister_args): - lister = new_lister(**lister_args) - lister.run(min_bound=lister.db_last_index()) - - @app.task(name=__name__ + '.FullPhabricatorLister') def full_phabricator_lister(**lister_args): lister = new_lister(**lister_args) diff --git a/swh/lister/phabricator/tests/test_tasks.py b/swh/lister/phabricator/tests/test_tasks.py index 0aa27d6..7651c7d 100644 --- a/swh/lister/phabricator/tests/test_tasks.py +++ b/swh/lister/phabricator/tests/test_tasks.py @@ -1,5 +1,3 @@ -from unittest.mock import patch - def test_ping(swh_app, celery_session_worker): res = swh_app.send_task( @@ -8,23 +6,3 @@ def test_ping(swh_app, celery_session_worker): res.wait() assert res.successful() assert res.result == 'OK' - - -@patch('swh.lister.phabricator.tasks.PhabricatorLister') -def test_incremental(lister, swh_app, celery_session_worker): - # setup the mocked PhabricatorLister - lister.return_value = lister - lister.db_last_index.return_value = 42 - lister.run.return_value = None - - res = swh_app.send_task( - 'swh.lister.phabricator.tasks.IncrementalPhabricatorLister') - assert res - res.wait() - assert res.successful() - - lister.assert_called_once_with( - api_token=None, forge_url='https://forge.softwareheritage.org', - instance='swh') - lister.db_last_index.assert_called_once_with() - lister.run.assert_called_once_with(min_bound=42)