summaryrefslogtreecommitdiff
path: root/openstackclient/tests/volume
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-07-26 10:53:40 +0000
committerGerrit Code Review <review@openstack.org>2016-07-26 10:53:40 +0000
commit6da7a127af4a5b7ba5fe92b6f09aefe605edb949 (patch)
treea4fa263f120aa942f1b625698f9a1af17fcdac0b /openstackclient/tests/volume
parent566b8566c00447b8ee8519debde56ddf0e7bf4cf (diff)
parente31408d2a4c524181c37ef565b021c0b729cbbe3 (diff)
downloadpython-openstackclient-6da7a127af4a5b7ba5fe92b6f09aefe605edb949.tar.gz
Merge "Add options to "volume type list" command"
Diffstat (limited to 'openstackclient/tests/volume')
-rw-r--r--openstackclient/tests/volume/v2/test_type.py33
1 files changed, 30 insertions, 3 deletions
diff --git a/openstackclient/tests/volume/v2/test_type.py b/openstackclient/tests/volume/v2/test_type.py
index e148bba4..9cf0f2fe 100644
--- a/openstackclient/tests/volume/v2/test_type.py
+++ b/openstackclient/tests/volume/v2/test_type.py
@@ -199,23 +199,50 @@ class TestTypeList(TestType):
def test_type_list_without_options(self):
arglist = []
verifylist = [
- ("long", False)
+ ("long", False),
+ ("private", False),
+ ("public", False),
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
+ self.types_mock.list.assert_called_once_with(is_public=None)
self.assertEqual(self.columns, columns)
self.assertEqual(self.data, list(data))
def test_type_list_with_options(self):
- arglist = ["--long"]
- verifylist = [("long", True)]
+ arglist = [
+ "--long",
+ "--public",
+ ]
+ verifylist = [
+ ("long", True),
+ ("private", False),
+ ("public", True),
+ ]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = self.cmd.take_action(parsed_args)
+ self.types_mock.list.assert_called_once_with(is_public=True)
self.assertEqual(self.columns_long, columns)
self.assertEqual(self.data_long, list(data))
+ def test_type_list_with_private_option(self):
+ arglist = [
+ "--private",
+ ]
+ verifylist = [
+ ("long", False),
+ ("private", True),
+ ("public", False),
+ ]
+ parsed_args = self.check_parser(self.cmd, arglist, verifylist)
+
+ columns, data = self.cmd.take_action(parsed_args)
+ self.types_mock.list.assert_called_once_with(is_public=False)
+ self.assertEqual(self.columns, columns)
+ self.assertEqual(self.data, list(data))
+
class TestTypeSet(TestType):