See #228: more performante federation import launch via API
This commit is contained in:
parent
4f8db661fa
commit
eded32c2e8
4 changed files with 25 additions and 7 deletions
|
|
@ -426,7 +426,8 @@ def test_library_track_action_import(
|
|||
lt2 = factories['federation.LibraryTrack'](library=lt1.library)
|
||||
lt3 = factories['federation.LibraryTrack']()
|
||||
lt4 = factories['federation.LibraryTrack'](library=lt3.library)
|
||||
mocker.patch('funkwhale_api.music.tasks.import_job_run')
|
||||
mocked_run = mocker.patch(
|
||||
'funkwhale_api.music.tasks.import_batch_run.delay')
|
||||
|
||||
payload = {
|
||||
'objects': 'all',
|
||||
|
|
@ -452,3 +453,4 @@ def test_library_track_action_import(
|
|||
assert batch.jobs.count() == 2
|
||||
for i, job in enumerate(batch.jobs.all()):
|
||||
assert job.library_track == imported_lts[i]
|
||||
mocked_run.assert_called_once_with(import_batch_id=batch.pk)
|
||||
|
|
|
|||
|
|
@ -47,6 +47,15 @@ def test_set_acoustid_on_track_file_required_high_score(factories, mocker):
|
|||
assert track_file.acoustid_track_id is None
|
||||
|
||||
|
||||
def test_import_batch_run(factories, mocker):
|
||||
job = factories['music.ImportJob']()
|
||||
mocked_job_run = mocker.patch(
|
||||
'funkwhale_api.music.tasks.import_job_run.delay')
|
||||
tasks.import_batch_run(import_batch_id=job.batch.pk)
|
||||
|
||||
mocked_job_run.assert_called_once_with(import_job_id=job.pk)
|
||||
|
||||
|
||||
def test_import_job_can_run_with_file_and_acoustid(
|
||||
artists, albums, tracks, preferences, factories, mocker):
|
||||
preferences['providers_acoustid__api_key'] = 'test'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue