Add one more test for YAQL error message format

Change-Id: I69d7551d380eb4feed957b8815624529ebcdeca9
Closes-Bug: #1630473
This commit is contained in:
Renat Akhmerov 2016-10-19 17:44:40 +07:00
parent 91068b5f08
commit f9c85bf876
1 changed files with 29 additions and 1 deletions

View File

@ -363,7 +363,7 @@ class ErrorHandlingEngineTest(base.EngineTestCase):
state=states.SUCCESS
)
def test_error_message_format(self):
def test_error_message_format_key_error(self):
wf_text = """
version: '2.0'
@ -390,3 +390,31 @@ class ErrorHandlingEngineTest(base.EngineTestCase):
self.assertIsNotNone(state_info)
self.assertTrue(state_info.find('error') < state_info.find('data'))
def test_error_message_format_unknown_function(self):
wf_text = """
version: '2.0'
wf:
tasks:
task1:
action: std.noop
publish:
my_var: <% invalid_yaql_function() %>
"""
wf_service.create_workflows(wf_text)
wf_ex = self.engine.start_workflow('wf', {})
self.await_workflow_error(wf_ex.id)
with db_api.transaction():
wf_ex = db_api.get_workflow_execution(wf_ex.id)
task_ex = wf_ex.task_executions[0]
state_info = task_ex.state_info
self.assertIsNotNone(state_info)
self.assertTrue(state_info.find('error') < state_info.find('data'))