示例#1
0
    def test_update_worker(self):
        req = _make_request(self._worker)

        self.assertTrue(self._worker.enabled)
        self.assertTrue(self._worker.ready)
        self.assertEqual(self._worker.task_count, 0)

        wi = worker.update_worker(req, False, False, 1)

        self.assertFalse(wi['enabled'])
        self.assertFalse(wi['ready'])
        self.assertEqual(wi['task_count'], 1)
    def test_update_worker(self):
        req = _make_request(self._worker)

        self.assertTrue(self._worker.enabled)
        self.assertTrue(self._worker.ready)
        self.assertEqual(self._worker.task_count, 0)

        wi = worker.update_worker(req, False, False, 1)

        self.assertFalse(wi['enabled'])
        self.assertFalse(wi['ready'])
        self.assertEqual(wi['task_count'], 1)
示例#3
0
 def update_worker(self, enabled, ready, task_count):
     return worker.update_worker(self._request, enabled, ready, task_count)
示例#4
0
 def test_update_worker(self):
     with self.assertRaises(PermissionDenied):
         worker.update_worker(_make_request(None, False), True, True, 0)
 def test_update_worker(self):
     with self.assertRaises(PermissionDenied):
         worker.update_worker(_make_request(None, False), True, True, 0)