def test_timerfunc_list(self, mock_test_list, mock_TestManager_run): cpulse = utils.get_cpulse_test() cpulse_obj = [objects.Cpulse(self.context, **cpulse)] mock_test_list.return_value = cpulse_obj timerthread.timerfunc() time.sleep(1) self.assertTrue(mock_TestManager_run.not_called)
def test_timerfunc_list_manual_test(self, mock_test_list, mock_TestManager_run): cpulse = utils.get_cpulse_test() cpulse['testtype'] = 'manual' cpulse_obj = [objects.Cpulse(self.context, **cpulse)] mock_test_list.return_value = cpulse_obj timerthread.timerfunc() time.sleep(1) mock_TestManager_run.assert_called_once_with(test=cpulse_obj[0])
def test_timerfunc_no_test(self, mock_test_list): timerthread.timerfunc()