Adding 'tags' to actions
Change-Id: I4fb5780b991c6c653847bae50d36d39b0517d49a
This commit is contained in:
11
AUTHORS
11
AUTHORS
@@ -1,4 +1,9 @@
|
|||||||
|
Anastasia Kuznetsova <akuznetsova@mirantis.com>
|
||||||
|
Angus Salkeld <angus.salkeld@rackspace.com>
|
||||||
|
Christian Berendt <berendt@b1-systems.de>
|
||||||
|
Dmitri Zimine <dz@stackstorm.com>
|
||||||
|
Kirill Izotov <enykeev@stackstorm.com>
|
||||||
|
Leandro I. Costantino <leandro.i.costantino@intel.com>
|
||||||
|
Nikolay Mahotkin <nmakhotkin@mirantis.com>
|
||||||
Renat Akhmerov <rakhmerov@mirantis.com>
|
Renat Akhmerov <rakhmerov@mirantis.com>
|
||||||
Nikolay Makhotkin <nmakhotkin@mirantis.com>
|
TimurNurlygayanov <tnurlygayanov@mirantis.com>
|
||||||
Alexander Kuznetsov <akuznetsov@mirantis.com>
|
|
||||||
|
|
||||||
|
@@ -30,14 +30,18 @@ def format(action=None):
|
|||||||
columns = (
|
columns = (
|
||||||
'Name',
|
'Name',
|
||||||
'Description',
|
'Description',
|
||||||
|
'Tags',
|
||||||
'Created at',
|
'Created at',
|
||||||
'Updated at'
|
'Updated at'
|
||||||
)
|
)
|
||||||
|
|
||||||
if action:
|
if action:
|
||||||
|
tags = getattr(action, 'tags', None) or []
|
||||||
|
|
||||||
data = (
|
data = (
|
||||||
action.name,
|
action.name,
|
||||||
getattr(action, 'description', '<none>'),
|
getattr(action, 'description', '<none>'),
|
||||||
|
', '.join(tags) or '<none>',
|
||||||
action.created_at,
|
action.created_at,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@ from mistralclient.api.v2 import actions
|
|||||||
ACTION_DICT = {
|
ACTION_DICT = {
|
||||||
'name': 'a',
|
'name': 'a',
|
||||||
'description': 'My cool action',
|
'description': 'My cool action',
|
||||||
|
'tags': ['test'],
|
||||||
'created_at': '1',
|
'created_at': '1',
|
||||||
'updated_at': '1'
|
'updated_at': '1'
|
||||||
}
|
}
|
||||||
@@ -53,7 +54,10 @@ class TestCLIActionsV2(base.BaseCommandTest):
|
|||||||
|
|
||||||
result = self.call(action_cmd.Create, app_args=['1.txt'])
|
result = self.call(action_cmd.Create, app_args=['1.txt'])
|
||||||
|
|
||||||
self.assertEqual([('a', 'My cool action', '1', '1')], result[1])
|
self.assertEqual(
|
||||||
|
[('a', 'My cool action', 'test', '1', '1')],
|
||||||
|
result[1]
|
||||||
|
)
|
||||||
|
|
||||||
@mock.patch('argparse.open', create=True)
|
@mock.patch('argparse.open', create=True)
|
||||||
@mock.patch('mistralclient.api.v2.actions.ActionManager.update')
|
@mock.patch('mistralclient.api.v2.actions.ActionManager.update')
|
||||||
@@ -62,7 +66,10 @@ class TestCLIActionsV2(base.BaseCommandTest):
|
|||||||
|
|
||||||
result = self.call(action_cmd.Update, app_args=['my_action.yaml'])
|
result = self.call(action_cmd.Update, app_args=['my_action.yaml'])
|
||||||
|
|
||||||
self.assertEqual([('a', 'My cool action', '1', '1')], result[1])
|
self.assertEqual(
|
||||||
|
[('a', 'My cool action', 'test', '1', '1')],
|
||||||
|
result[1]
|
||||||
|
)
|
||||||
|
|
||||||
@mock.patch('mistralclient.api.v2.actions.ActionManager.list')
|
@mock.patch('mistralclient.api.v2.actions.ActionManager.list')
|
||||||
def test_list(self, mock):
|
def test_list(self, mock):
|
||||||
@@ -70,7 +77,10 @@ class TestCLIActionsV2(base.BaseCommandTest):
|
|||||||
|
|
||||||
result = self.call(action_cmd.List)
|
result = self.call(action_cmd.List)
|
||||||
|
|
||||||
self.assertEqual([('a', 'My cool action', '1', '1')], result[1])
|
self.assertEqual(
|
||||||
|
[('a', 'My cool action', 'test', '1', '1')],
|
||||||
|
result[1]
|
||||||
|
)
|
||||||
|
|
||||||
@mock.patch('mistralclient.api.v2.actions.ActionManager.get')
|
@mock.patch('mistralclient.api.v2.actions.ActionManager.get')
|
||||||
def test_get(self, mock):
|
def test_get(self, mock):
|
||||||
@@ -78,7 +88,7 @@ class TestCLIActionsV2(base.BaseCommandTest):
|
|||||||
|
|
||||||
result = self.call(action_cmd.Get, app_args=['name'])
|
result = self.call(action_cmd.Get, app_args=['name'])
|
||||||
|
|
||||||
self.assertEqual(('a', 'My cool action', '1', '1'), result[1])
|
self.assertEqual(('a', 'My cool action', 'test', '1', '1'), result[1])
|
||||||
|
|
||||||
@mock.patch('mistralclient.api.v2.actions.ActionManager.delete')
|
@mock.patch('mistralclient.api.v2.actions.ActionManager.delete')
|
||||||
def test_delete(self, mock):
|
def test_delete(self, mock):
|
||||||
|
Reference in New Issue
Block a user