diff options
| author | Huanxuan Ao <huanxuan.ao@easystack.cn> | 2016-07-18 15:14:51 +0800 |
|---|---|---|
| committer | Huanxuan Ao <huanxuan.ao@easystack.cn> | 2016-07-23 11:26:49 +0800 |
| commit | e31408d2a4c524181c37ef565b021c0b729cbbe3 (patch) | |
| tree | fd4096577a1606bef30620e9b70a6cecc30989b1 /openstackclient/tests | |
| parent | 9f6148132cc21a6f78b5ebb7c1282b30a309ef8a (diff) | |
| download | python-openstackclient-e31408d2a4c524181c37ef565b021c0b729cbbe3.tar.gz | |
Add options to "volume type list" command
Add "--public" and "--private" options to
"volume type command" in volumev2 (v2 only)
to list optional volume types
Change-Id: I8605990d62116c10d89ce192c14e550657dabee5
Closes-Bug: #1597198
Diffstat (limited to 'openstackclient/tests')
| -rw-r--r-- | openstackclient/tests/volume/v2/test_type.py | 33 |
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 174f33f2..e1c2c1db 100644 --- a/openstackclient/tests/volume/v2/test_type.py +++ b/openstackclient/tests/volume/v2/test_type.py @@ -176,23 +176,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): |
