diff options
| author | Zuul <zuul@review.opendev.org> | 2022-11-10 13:10:21 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2022-11-10 13:10:21 +0000 |
| commit | 50015b96085c625b1ceaeab880db9271d7e94647 (patch) | |
| tree | bc19668653657c15560561a246c48672deacb6ff /openstackclient/tests/functional/common/test_configuration.py | |
| parent | d5b6f5a1835049a2232b4632e7f618175fc3725d (diff) | |
| parent | 38e39b6dc14fd88318541728cb34fd8442d59e8a (diff) | |
| download | python-openstackclient-50015b96085c625b1ceaeab880db9271d7e94647.tar.gz | |
Merge "tests: Convert more functional tests to use 'parse_output'"
Diffstat (limited to 'openstackclient/tests/functional/common/test_configuration.py')
| -rw-r--r-- | openstackclient/tests/functional/common/test_configuration.py | 24 |
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, |
