Skip to content
Snippets Groups Projects
Verified Commit df2754e5 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

phabricator.tasks: Remove unused code

Related T1824
Related P438
parent af681ac1
No related branches found
Tags v0.0.23
No related merge requests found
......@@ -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)
......
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)
  • Phabricator Migration user @phabricator-migration ·
    Owner

    Some references in the commit message have been migrated:

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment