Merge "Add the unit test for executions detail"
This commit is contained in:
commit
050a8d0838
@ -38,3 +38,19 @@ class ExecutionsTest(test.TestCase):
|
|||||||
marker=None,
|
marker=None,
|
||||||
sort_dirs='desc',
|
sort_dirs='desc',
|
||||||
paginate=True)
|
paginate=True)
|
||||||
|
|
||||||
|
@helpers.create_mocks({api: ('execution_get', 'task_list')})
|
||||||
|
def test_detail(self):
|
||||||
|
execution = self.mistralclient_executions.list()[0]
|
||||||
|
tasks = self.mistralclient_tasks.list()
|
||||||
|
self.mock_execution_get.return_value = execution
|
||||||
|
self.mock_task_list.return_value = tasks
|
||||||
|
url = reverse('horizon:mistral:executions:detail',
|
||||||
|
args=[execution.id])
|
||||||
|
res = self.client.get(url)
|
||||||
|
|
||||||
|
self.assertTemplateUsed(res, 'mistral/executions/detail.html')
|
||||||
|
self.mock_execution_get.assert_called_once_with(
|
||||||
|
helpers.IsHttpRequest(), execution.id)
|
||||||
|
self.mock_task_list.assert_called_once_with(
|
||||||
|
helpers.IsHttpRequest(), execution.id)
|
||||||
|
@ -83,12 +83,10 @@ def data(TEST):
|
|||||||
'workflow_name': 'my_wf',
|
'workflow_name': 'my_wf',
|
||||||
'description': '',
|
'description': '',
|
||||||
'state': 'RUNNING',
|
'state': 'RUNNING',
|
||||||
'input': {
|
'input': '{"person": {"first_name": "John", "last_name": "Doe"}}',
|
||||||
'person': {
|
'output': "1",
|
||||||
'first_name': 'John',
|
'params': "1",
|
||||||
'last_name': 'Doe'
|
|
||||||
}
|
}
|
||||||
}}
|
|
||||||
)
|
)
|
||||||
TEST.mistralclient_executions.add(execution_1)
|
TEST.mistralclient_executions.add(execution_1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user