@mock.patch.object(action_db_util, 'get_action_by_ref',
                       mock.MagicMock(return_value=ACTION_1))
    @mock.patch.object(action_service, 'request', return_value=(DummyActionExecution(), None))
    def test_chain_runner_publish_param_rendering_failure(self, request):
        # Parameter rendering should result in a top level error which aborts
        # the whole chain
        chain_runner = acr.get_runner()
        chain_runner.entry_point = CHAIN_WITH_PUBLISH_PARAM_RENDERING_FAILURE
        chain_runner.action = ACTION_1
        chain_runner.container_service = RunnerContainerService()
        chain_runner.pre_run()

        try:
            chain_runner.run({})
        except ParameterRenderingFailedException as e:
            # TODO: Should we treat this as task error? Right now it bubbles all
            # the way up and it's not really consistent with action param
            # rendering failure
            expected_error = ('Failed rendering value for publish parameter "p1" in '
                              'task "c2" (template string={{ not_defined }}):')
            self.assertTrue(expected_error in str(e))
            pass
        else:
            self.fail('Exception was not thrown')
dataset/ETHPy150Open StackStorm/st2/st2actions/tests/unit/test_actionchain.py/TestActionChainRunner.test_chain_runner_publish_param_rendering_failure/original