summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-07-25 02:49:02 +0000
committerGerrit Code Review <review@openstack.org>2018-07-25 02:49:02 +0000
commitcc037e22a6fa0f35b5a9d8c66a357596ad4b2177 (patch)
treed1ba067e1620bd8d893c113dfacfa0947521d7e3 /openstackclient/tests
parent6469d86522f16a12e3437b70dc5f68a67314c691 (diff)
parent860639a548a2c07193662cd361432cb5061c2a7f (diff)
downloadpython-openstackclient-cc037e22a6fa0f35b5a9d8c66a357596ad4b2177.tar.gz
Merge "Support --community in openstack image list"
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/unit/image/v2/test_image.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/image/v2/test_image.py b/openstackclient/tests/unit/image/v2/test_image.py
index e7cd34c3..170a7f03 100644
--- a/openstackclient/tests/unit/image/v2/test_image.py
+++ b/openstackclient/tests/unit/image/v2/test_image.py
@@ -527,6 +527,7 @@ class TestImageList(TestImage):
verifylist = [
('public', False),
('private', False),
+ ('community', False),
('shared', False),
('long', False),
]
@@ -550,6 +551,7 @@ class TestImageList(TestImage):
verifylist = [
('public', True),
('private', False),
+ ('community', False),
('shared', False),
('long', False),
]
@@ -574,6 +576,7 @@ class TestImageList(TestImage):
verifylist = [
('public', False),
('private', True),
+ ('community', False),
('shared', False),
('long', False),
]
@@ -591,6 +594,31 @@ class TestImageList(TestImage):
self.assertEqual(self.columns, columns)
self.assertEqual(self.datalist, tuple(data))
+ def test_image_list_community_option(self):
+ arglist = [
+ '--community',
+ ]
+ verifylist = [
+ ('public', False),
+ ('private', False),
+ ('community', True),
+ ('shared', False),
+ ('long', False),
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+
+ # In base command class Lister in cliff, abstract method take_action()
+ # returns a tuple containing the column names and an iterable
+ # containing the data to be listed.
+ columns, data = self.cmd.take_action(parsed_args)
+ self.api_mock.image_list.assert_called_with(
+ community=True,
+ marker=self._image.id,
+ )
+
+ self.assertEqual(self.columns, columns)
+ self.assertEqual(self.datalist, tuple(data))
+
def test_image_list_shared_option(self):
arglist = [
'--shared',
@@ -598,6 +626,7 @@ class TestImageList(TestImage):
verifylist = [
('public', False),
('private', False),
+ ('community', False),
('shared', True),
('long', False),
]