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 update_worker(self, enabled, ready, task_count): return worker.update_worker(self._request, enabled, ready, task_count)
def test_update_worker(self): with self.assertRaises(PermissionDenied): worker.update_worker(_make_request(None, False), True, True, 0)