phabricator.tasks: Remove unused code
Related T1824 Related P438
This commit is contained in:
parent
af681ac128
commit
df2754e5a6
2 changed files with 0 additions and 28 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue