コード例 #1
0
    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)
コード例 #2
0
    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)
コード例 #3
0
 def check_wait(self, task_id, child_list=None):
     return worker.check_wait(self._request, task_id, child_list)
コード例 #4
0
 def test_check_wait(self):
     with self.assertRaises(PermissionDenied):
         worker.check_wait(_make_request(None, False), 1)
コード例 #5
0
 def test_check_wait(self):
     with self.assertRaises(PermissionDenied):
         worker.check_wait(_make_request(None, False), 1)