Remove tests for the async action runners
@@ -330,87 +330,6 @@ class RunnerContainerTest(DbTestCase):
self.assertTrue(result.get('action_params').get('actionint') == 20)
self.assertTrue(result.get('action_params').get('actionstr') == 'foo')
- def test_state_db_created_for_polling_async_actions(self):
- runner_container = get_runner_container()
-
- params = {
- 'actionstr': 'foo',
- 'actionint': 20,
- 'async_test': True
- }
-
- liveaction_db = self._get_liveaction_model(
- RunnerContainerTest.polling_async_action_db,
- params
- )
-
- liveaction_db = LiveAction.add_or_update(liveaction_db)
- executions.create_execution_object(liveaction_db)
-
- # Assert that execution ran without exceptions.
- with mock.patch('st2actions.container.base.get_runner',
- mock.Mock(return_value=polling_async_runner.get_runner())):
- runner_container.dispatch(liveaction_db)
- states = ActionExecutionState.get_all()
- found = [state for state in states if state.execution_id == liveaction_db.id]
-
- self.assertTrue(len(found) > 0, 'There should be a state db object.')
- self.assertTrue(len(found) == 1, 'There should only be one state db object.')
- self.assertIsNotNone(found[0].query_context)
- self.assertIsNotNone(found[0].query_module)
-
- @mock.patch.object(
- PollingAsyncActionRunner,
- 'is_polling_enabled',
- mock.MagicMock(return_value=False))
- def test_state_db_not_created_for_disabled_polling_async_actions(self):
- runner_container = get_runner_container()
-
- params = {
- 'actionstr': 'foo',
- 'actionint': 20,
- 'async_test': True
- }
-
- liveaction_db = self._get_liveaction_model(
- RunnerContainerTest.polling_async_action_db,
- params
- )
-
- liveaction_db = LiveAction.add_or_update(liveaction_db)
- executions.create_execution_object(liveaction_db)
-
- # Assert that execution ran without exceptions.
- runner_container.dispatch(liveaction_db)
- states = ActionExecutionState.get_all()
- found = [state for state in states if state.execution_id == liveaction_db.id]
-
- self.assertTrue(len(found) == 0, 'There should not be a state db object.')
-
- def test_state_db_not_created_for_async_actions(self):
- runner_container = get_runner_container()
-
- params = {
- 'actionstr': 'foo',
- 'actionint': 20,
- 'async_test': True
- }
-
- liveaction_db = self._get_liveaction_model(
- RunnerContainerTest.async_action_db,
- params
- )
-
- liveaction_db = LiveAction.add_or_update(liveaction_db)
- executions.create_execution_object(liveaction_db)
-
- # Assert that execution ran without exceptions.
- runner_container.dispatch(liveaction_db)
- states = ActionExecutionState.get_all()
- found = [state for state in states if state.execution_id == liveaction_db.id]
-
- self.assertTrue(len(found) == 0, 'There should not be a state db object.')
-
def _get_liveaction_model(self, action_db, params):
status = action_constants.LIVEACTION_STATUS_REQUESTED
start_timestamp = date_utils.get_datetime_utc_now()
