summaryrefslogtreecommitdiff
path: root/openstackclient/tests/common/test_configuration.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests/common/test_configuration.py')
-rw-r--r--openstackclient/tests/common/test_configuration.py85
1 files changed, 0 insertions, 85 deletions
diff --git a/openstackclient/tests/common/test_configuration.py b/openstackclient/tests/common/test_configuration.py
deleted file mode 100644
index 915e5bd3..00000000
--- a/openstackclient/tests/common/test_configuration.py
+++ /dev/null
@@ -1,85 +0,0 @@
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-
-import mock
-
-from openstackclient.common import configuration
-from openstackclient.tests import fakes
-from openstackclient.tests import utils
-
-
-class TestConfiguration(utils.TestCommand):
-
- columns = (
- 'auth.password',
- 'auth.token',
- 'auth.username',
- 'identity_api_version',
- 'region',
- )
- datalist = (
- configuration.REDACTED,
- configuration.REDACTED,
- fakes.USERNAME,
- fakes.VERSION,
- fakes.REGION_NAME,
- )
-
- opts = [mock.Mock(secret=True, dest="password"),
- mock.Mock(secret=True, dest="token")]
-
- @mock.patch("keystoneauth1.loading.base.get_plugin_options",
- return_value=opts)
- def test_show(self, m_get_plugin_opts):
- arglist = []
- verifylist = [('mask', True)]
- cmd = configuration.ShowConfiguration(self.app, None)
- parsed_args = self.check_parser(cmd, arglist, verifylist)
-
- columns, data = cmd.take_action(parsed_args)
-
- self.assertEqual(self.columns, columns)
- self.assertEqual(self.datalist, data)
-
- @mock.patch("keystoneauth1.loading.base.get_plugin_options",
- return_value=opts)
- def test_show_unmask(self, m_get_plugin_opts):
- arglist = ['--unmask']
- verifylist = [('mask', False)]
- cmd = configuration.ShowConfiguration(self.app, None)
- parsed_args = self.check_parser(cmd, arglist, verifylist)
-
- columns, data = cmd.take_action(parsed_args)
-
- self.assertEqual(self.columns, columns)
- datalist = (
- fakes.PASSWORD,
- fakes.AUTH_TOKEN,
- fakes.USERNAME,
- fakes.VERSION,
- fakes.REGION_NAME,
- )
- self.assertEqual(datalist, data)
-
- @mock.patch("keystoneauth1.loading.base.get_plugin_options",
- return_value=opts)
- def test_show_mask(self, m_get_plugin_opts):
- arglist = ['--mask']
- verifylist = [('mask', True)]
- cmd = configuration.ShowConfiguration(self.app, None)
- parsed_args = self.check_parser(cmd, arglist, verifylist)
-
- columns, data = cmd.take_action(parsed_args)
-
- self.assertEqual(self.columns, columns)
- self.assertEqual(self.datalist, data)