summaryrefslogtreecommitdiff
path: root/heatclient/tests/unit/osc/v1/test_stack.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-02-13 09:50:30 +0000
committerGerrit Code Review <review@openstack.org>2017-02-13 09:50:30 +0000
commit28cf99603a308640af604a83f3b3083ce3ad0d35 (patch)
treeaafb1da700e74e132dde8b9f1d2a5aa0a5e679fa /heatclient/tests/unit/osc/v1/test_stack.py
parent0b6aeafbf9a1873bb503f0482e4aeafd95ebfd57 (diff)
parent3ee70cf4e8c2d8505230f73ef0b6b44185567dc2 (diff)
downloadpython-heatclient-28cf99603a308640af604a83f3b3083ce3ad0d35.tar.gz
Merge "Show 'project' info if heat server returns"
Diffstat (limited to 'heatclient/tests/unit/osc/v1/test_stack.py')
-rw-r--r--heatclient/tests/unit/osc/v1/test_stack.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/heatclient/tests/unit/osc/v1/test_stack.py b/heatclient/tests/unit/osc/v1/test_stack.py
index 66a6992..8239f48 100644
--- a/heatclient/tests/unit/osc/v1/test_stack.py
+++ b/heatclient/tests/unit/osc/v1/test_stack.py
@@ -465,6 +465,9 @@ class TestStackList(TestStack):
'deletion_time': '2015-10-21T07:50:00Z',
}
+ data_with_project = copy.deepcopy(data)
+ data_with_project['project'] = 'test_project'
+
def setUp(self):
super(TestStackList, self).setUp()
self.cmd = stack.ListStack(self.app, None)
@@ -507,6 +510,8 @@ class TestStackList(TestStack):
self.assertEqual(cols, columns)
def test_stack_list_all_projects(self):
+ self.stack_client.list.return_value = [
+ stacks.Stack(None, self.data_with_project)]
kwargs = copy.deepcopy(self.defaults)
kwargs['global_tenant'] = True
cols = copy.deepcopy(self.columns)
@@ -519,7 +524,23 @@ class TestStackList(TestStack):
self.stack_client.list.assert_called_with(**kwargs)
self.assertEqual(cols, columns)
+ def test_stack_list_with_project(self):
+ self.stack_client.list.return_value = [
+ stacks.Stack(None, self.data_with_project)]
+ kwargs = copy.deepcopy(self.defaults)
+ cols = copy.deepcopy(self.columns)
+ cols.insert(2, 'Project')
+ arglist = []
+ parsed_args = self.check_parser(self.cmd, arglist, [])
+
+ columns, data = self.cmd.take_action(parsed_args)
+
+ self.stack_client.list.assert_called_with(**kwargs)
+ self.assertEqual(cols, columns)
+
def test_stack_list_long(self):
+ self.stack_client.list.return_value = [
+ stacks.Stack(None, self.data_with_project)]
kwargs = copy.deepcopy(self.defaults)
kwargs['global_tenant'] = True
cols = copy.deepcopy(self.columns)