From 633e2998419dcd20b967bafd29255b66297c5b53 Mon Sep 17 00:00:00 2001 From: Dmitri Zimine Date: Wed, 17 Sep 2014 22:09:10 -0700 Subject: [PATCH] Trivial: improve ad-hoc action test Make it more readable and representative of various cases. Change-Id: Ib8cb4fe188d8ef65a0dca9d5b34d0fa9b8a6389d --- .../tests/unit/engine1/test_adhoc_actions.py | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/mistral/tests/unit/engine1/test_adhoc_actions.py b/mistral/tests/unit/engine1/test_adhoc_actions.py index f57b39cc..d896b09d 100644 --- a/mistral/tests/unit/engine1/test_adhoc_actions.py +++ b/mistral/tests/unit/engine1/test_adhoc_actions.py @@ -31,11 +31,14 @@ WORKBOOK = """ version: '2.0' actions: - my_action: + concat_twice: base: std.echo base-parameters: - output: "{$.str1}{$.str2}" - output: "{$}{$}" + output: "{$.s1}+{$.s2}" + parameters: + - s1 + - s2 + output: "{$} and {$}" workflows: wf1: @@ -44,11 +47,12 @@ workflows: - str1 - str2 output: - result: $.result + workflow_result: $.result # This access to execution context variables + concat_task_result: $.task.concat # This access to task raw result tasks: - task1: - action: my_action str1='{$.str1}' str2='{$.str2}' + concat: + action: concat_twice s1={$.str1} s2={$.str2} publish: result: $ """ @@ -74,4 +78,6 @@ class AdhocActionsTest(base.EngineTestCase): exec_db = db_api.get_execution(exec_db.id) - self.assertDictEqual({'result': 'abab'}, exec_db.output) + self.assertDictEqual({'workflow_result': 'a+b and a+b', + 'concat_task_result': 'a+b and a+b'}, + exec_db.output)