def test_poll(self): task = BaseTask(self.project_config, self.task_config, self.org_config) task.i = 0 def mimic_polling(): task.i += 1 if task.i > 3: task.poll_complete = True task._poll_action = mock.Mock(side_effect=mimic_polling) task._poll() self.assertEqual(4, task.poll_count) self.assertEqual(1, task.poll_interval_level) self.assertEqual(2, task.poll_interval_s)
def test_poll(self): task = BaseTask(self.project_config, self.task_config, self.org_config) task.i = 0 def mimic_polling(): task.i += 1 if task.i > 3: task.poll_complete = True task._poll_action = mock.Mock(side_effect=mimic_polling) task._poll() self.assertEqual(4, task.poll_count) self.assertEqual(1, task.poll_interval_level) self.assertEqual(2, task.poll_interval_s)
def test_poll_action(self): task = BaseTask(self.project_config, self.task_config, self.org_config) with self.assertRaises(NotImplementedError): task._poll_action()
def test_poll_action(self): task = BaseTask(self.project_config, self.task_config, self.org_config) with self.assertRaises(NotImplementedError): task._poll_action()