summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/common/test_configuration.py
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2022-11-07 17:21:12 +0000
committerStephen Finucane <sfinucan@redhat.com>2022-11-08 16:39:05 +0000
commit38e39b6dc14fd88318541728cb34fd8442d59e8a (patch)
tree358f6ffac57759854cba3e3a72a67658c6ba2876 /openstackclient/tests/functional/common/test_configuration.py
parenta244bb84e07617dad12dee91bbe63bdca3357b1e (diff)
downloadpython-openstackclient-38e39b6dc14fd88318541728cb34fd8442d59e8a.tar.gz
tests: Convert more functional tests to use 'parse_output'
Change-Id: I1d968181eb196c6df4583c772c67ed58bc7ba585 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/tests/functional/common/test_configuration.py')
-rw-r--r--openstackclient/tests/functional/common/test_configuration.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/openstackclient/tests/functional/common/test_configuration.py b/openstackclient/tests/functional/common/test_configuration.py
index 17e0f45d..614b3e46 100644
--- a/openstackclient/tests/functional/common/test_configuration.py
+++ b/openstackclient/tests/functional/common/test_configuration.py
@@ -10,7 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import json
import os
from openstackclient.common import configuration
@@ -30,9 +29,7 @@ class ConfigurationTests(base.TestCase):
items = self.parse_listing(raw_output)
self.assert_table_structure(items, BASIC_CONFIG_HEADERS)
- cmd_output = json.loads(self.openstack(
- 'configuration show -f json'
- ))
+ cmd_output = self.openstack('configuration show', parse_output=True)
self.assertEqual(
configuration.REDACTED,
cmd_output['auth.password']
@@ -43,18 +40,18 @@ class ConfigurationTests(base.TestCase):
)
# Test show --mask
- cmd_output = json.loads(self.openstack(
- 'configuration show --mask -f json'
- ))
+ cmd_output = self.openstack(
+ 'configuration show --mask', parse_output=True,
+ )
self.assertEqual(
configuration.REDACTED,
cmd_output['auth.password']
)
# Test show --unmask
- cmd_output = json.loads(self.openstack(
- 'configuration show --unmask -f json'
- ))
+ cmd_output = self.openstack(
+ 'configuration show --unmask', parse_output=True,
+ )
# If we are using os-client-config, this will not be set. Rather than
# parse clouds.yaml to get the right value, just make sure
# we are not getting redacted.
@@ -84,10 +81,11 @@ class ConfigurationTestsNoAuth(base.TestCase):
items = self.parse_listing(raw_output)
self.assert_table_structure(items, BASIC_CONFIG_HEADERS)
- cmd_output = json.loads(self.openstack(
- 'configuration show -f json',
+ cmd_output = self.openstack(
+ 'configuration show',
cloud=None,
- ))
+ parse_output=True,
+ )
self.assertNotIn(
'auth.password',
cmd_output,