Add the unit test for executions
Change-Id: I89145b7bb71cbcb74c7a29534362bbf0c558a5f7
This commit is contained in:
parent
37e16b2753
commit
e5b94ec93b
|
@ -39,6 +39,22 @@ class ExecutionsTest(test.TestCase):
|
||||||
sort_dirs='desc',
|
sort_dirs='desc',
|
||||||
paginate=True)
|
paginate=True)
|
||||||
|
|
||||||
|
@helpers.create_mocks({api: ('execution_update',)})
|
||||||
|
def test_update_post(self):
|
||||||
|
execution = self.mistralclient_executions.first()
|
||||||
|
self.mock_execution_update.return_value = execution
|
||||||
|
form_data = {
|
||||||
|
"execution_id": execution.id,
|
||||||
|
"description": "description"}
|
||||||
|
res = self.client.post(
|
||||||
|
reverse('horizon:mistral:executions:update_description',
|
||||||
|
args=(execution.id,)),
|
||||||
|
form_data)
|
||||||
|
self.assertNoFormErrors(res)
|
||||||
|
self.mock_execution_update.assert_called_once_with(
|
||||||
|
helpers.IsHttpRequest(), execution.id,
|
||||||
|
"description", "description")
|
||||||
|
|
||||||
@helpers.create_mocks({api: ('execution_get', 'task_list')})
|
@helpers.create_mocks({api: ('execution_get', 'task_list')})
|
||||||
def test_detail(self):
|
def test_detail(self):
|
||||||
execution = self.mistralclient_executions.list()[0]
|
execution = self.mistralclient_executions.list()[0]
|
||||||
|
|
Loading…
Reference in New Issue