From bf8fea55cb99214c278dbd4abbc99328d749fe5d Mon Sep 17 00:00:00 2001 From: olivier Date: Fri, 25 Oct 2024 15:47:28 +0100 Subject: [PATCH] fix task queue test --- ibllib/tests/test_pipes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ibllib/tests/test_pipes.py b/ibllib/tests/test_pipes.py index 56ef51e68..9383d6dad 100644 --- a/ibllib/tests/test_pipes.py +++ b/ibllib/tests/test_pipes.py @@ -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 @@ -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)