Merge "Fix 'is_system' property in action commands"
This commit is contained in:
@@ -29,6 +29,7 @@ LOG = logging.getLogger(__name__)
|
||||
def format(action=None):
|
||||
columns = (
|
||||
'Name',
|
||||
'Is system',
|
||||
'Description',
|
||||
'Tags',
|
||||
'Created at',
|
||||
@@ -40,6 +41,7 @@ def format(action=None):
|
||||
|
||||
data = (
|
||||
action.name,
|
||||
action.is_system,
|
||||
getattr(action, 'description', '<none>'),
|
||||
', '.join(tags) or '<none>',
|
||||
action.created_at,
|
||||
|
@@ -24,6 +24,7 @@ from mistralclient.api.v2 import actions
|
||||
|
||||
ACTION_DICT = {
|
||||
'name': 'a',
|
||||
'is_system': True,
|
||||
'description': 'My cool action',
|
||||
'tags': ['test'],
|
||||
'created_at': '1',
|
||||
@@ -55,7 +56,7 @@ class TestCLIActionsV2(base.BaseCommandTest):
|
||||
result = self.call(action_cmd.Create, app_args=['1.txt'])
|
||||
|
||||
self.assertEqual(
|
||||
[('a', 'My cool action', 'test', '1', '1')],
|
||||
[('a', True, 'My cool action', 'test', '1', '1')],
|
||||
result[1]
|
||||
)
|
||||
|
||||
@@ -67,7 +68,7 @@ class TestCLIActionsV2(base.BaseCommandTest):
|
||||
result = self.call(action_cmd.Update, app_args=['my_action.yaml'])
|
||||
|
||||
self.assertEqual(
|
||||
[('a', 'My cool action', 'test', '1', '1')],
|
||||
[('a', True, 'My cool action', 'test', '1', '1')],
|
||||
result[1]
|
||||
)
|
||||
|
||||
@@ -78,7 +79,7 @@ class TestCLIActionsV2(base.BaseCommandTest):
|
||||
result = self.call(action_cmd.List)
|
||||
|
||||
self.assertEqual(
|
||||
[('a', 'My cool action', 'test', '1', '1')],
|
||||
[('a', True, 'My cool action', 'test', '1', '1')],
|
||||
result[1]
|
||||
)
|
||||
|
||||
@@ -88,7 +89,10 @@ class TestCLIActionsV2(base.BaseCommandTest):
|
||||
|
||||
result = self.call(action_cmd.Get, app_args=['name'])
|
||||
|
||||
self.assertEqual(('a', 'My cool action', 'test', '1', '1'), result[1])
|
||||
self.assertEqual(
|
||||
('a', True, 'My cool action', 'test', '1', '1'),
|
||||
result[1]
|
||||
)
|
||||
|
||||
@mock.patch('mistralclient.api.v2.actions.ActionManager.delete')
|
||||
def test_delete(self, mock):
|
||||
|
Reference in New Issue
Block a user