Add the unit test for tasks detail
Change-Id: I185fc97d5da6d7686707138b10799a2d2986a7d3
This commit is contained in:
parent
d1df6b3998
commit
c4fd4d8e64
@ -34,3 +34,14 @@ class TasksTest(test.TestCase):
|
||||
self.assertItemsEqual(res.context['table'].data,
|
||||
self.mistralclient_tasks.list())
|
||||
self.mock_task_list.assert_called_once_with(helpers.IsHttpRequest())
|
||||
|
||||
@helpers.create_mocks({api: ('task_get',)})
|
||||
def test_detail(self):
|
||||
task = self.mistralclient_tasks.list()[0]
|
||||
self.mock_task_get.return_value = task
|
||||
url = reverse('horizon:mistral:tasks:detail',
|
||||
args=[task.id])
|
||||
res = self.client.get(url)
|
||||
self.assertTemplateUsed(res, 'mistral/tasks/detail.html')
|
||||
self.mock_task_get.assert_called_once_with(
|
||||
helpers.IsHttpRequest(), task.id)
|
||||
|
@ -103,7 +103,8 @@ def data(TEST):
|
||||
'state': 'RUNNING',
|
||||
'type': 'ACTION',
|
||||
'tags': ['deployment', 'demo'],
|
||||
'result': {'some': 'result'}})
|
||||
'result': "1",
|
||||
'published': '{"a":"1"}'})
|
||||
TEST.mistralclient_tasks.add(task_1)
|
||||
|
||||
# Workbooks
|
||||
|
Loading…
x
Reference in New Issue
Block a user