Merge "Fix 'is_system' property in action commands"

This commit is contained in:
Jenkins
2014-10-01 02:06:35 +00:00
committed by Gerrit Code Review
2 changed files with 10 additions and 4 deletions

View File

@@ -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,

View File

@@ -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):