Skip to content

Commit

Permalink
fix task queue test
Browse files Browse the repository at this point in the history
  • Loading branch information
oliche committed Oct 25, 2024
1 parent 98fc54a commit bf8fea5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ibllib/tests/test_pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def test_task_queue(self, lab_repo_mock):
lab_repo_mock.return_value = 'foo_repo'
tasks = [
{'executable': 'ibllib.pipes.mesoscope_tasks.MesoscopePreprocess', 'priority': 80},
{'executable': 'ibllib.pipes.ephys_tasks.SpikeSorting', 'priority': SpikeSorting.priority},
{'executable': 'ibllib.pipes.base_tasks.RegisterRawDataTask', 'priority': RegisterRawDataTask.priority}
{'executable': 'ibllib.pipes.ephys_tasks.SpikeSorting', 'priority': SpikeSorting.priority}, # 60
{'executable': 'ibllib.pipes.base_tasks.RegisterRawDataTask', 'priority': RegisterRawDataTask.priority} # 100
]
alyx = mock.Mock(spec=AlyxClient)
alyx.rest.return_value = tasks
Expand All @@ -49,10 +49,10 @@ def test_task_queue(self, lab_repo_mock):
self.assertIn('foolab', alyx.rest.call_args.kwargs.get('django', ''))
self.assertIn('foo_repo', alyx.rest.call_args.kwargs.get('django', ''))
# Expect to return tasks in descending priority order, without mesoscope task (different env)
self.assertEqual([tasks[2], tasks[1]], queue)
self.assertEqual([tasks[2]], queue)
# Expect only mesoscope task returned when relevant env passed
queue = local_server.task_queue(lab='foolab', alyx=alyx, env=('suite2p',))
self.assertEqual([tasks[0]], queue)
queue = local_server.task_queue(lab='foolab', alyx=alyx, env=('suite2p', 'iblsorter'))
self.assertEqual([tasks[0], tasks[1]], queue)
# Expect no tasks as mesoscope task is a large job
queue = local_server.task_queue(mode='small', lab='foolab', alyx=alyx, env=('suite2p',))
self.assertEqual([], queue)
Expand Down

0 comments on commit bf8fea5

Please sign in to comment.