def test_check_wait_subtasks_not_finished(self): t_parent = Task.objects.create( worker=self._worker, arch=self._arch, channel=self._channel, owner=self._user, state=TASK_STATES['FREE'], ) Task.objects.create( worker=self._worker, arch=self._arch, channel=self._channel, owner=self._user, state=TASK_STATES['FREE'], parent=t_parent, ) Task.objects.create( worker=self._worker, arch=self._arch, channel=self._channel, owner=self._user, state=TASK_STATES['FREE'], parent=t_parent, ) req = _make_request(self._worker) finished, unfinished = worker.check_wait(req, t_parent.id) self.assertEqual(len(finished), 0) self.assertEqual(len(unfinished), 2)
def check_wait(self, task_id, child_list=None): return worker.check_wait(self._request, task_id, child_list)
def test_check_wait(self): with self.assertRaises(PermissionDenied): worker.check_wait(_make_request(None, False), 1)