summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/common/test_args.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-11-10 13:10:21 +0000
committerGerrit Code Review <review@openstack.org>2022-11-10 13:10:21 +0000
commit50015b96085c625b1ceaeab880db9271d7e94647 (patch)
treebc19668653657c15560561a246c48672deacb6ff /openstackclient/tests/functional/common/test_args.py
parentd5b6f5a1835049a2232b4632e7f618175fc3725d (diff)
parent38e39b6dc14fd88318541728cb34fd8442d59e8a (diff)
downloadpython-openstackclient-50015b96085c625b1ceaeab880db9271d7e94647.tar.gz
Merge "tests: Convert more functional tests to use 'parse_output'"
Diffstat (limited to 'openstackclient/tests/functional/common/test_args.py')
-rw-r--r--openstackclient/tests/functional/common/test_args.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/openstackclient/tests/functional/common/test_args.py b/openstackclient/tests/functional/common/test_args.py
index 02cad6c1..1f5ecc1c 100644
--- a/openstackclient/tests/functional/common/test_args.py
+++ b/openstackclient/tests/functional/common/test_args.py
@@ -10,8 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import json
-
from tempest.lib import exceptions as tempest_exc
from openstackclient.tests.functional import base
@@ -21,10 +19,11 @@ class ArgumentTests(base.TestCase):
"""Functional tests for command line arguments"""
def test_default_auth_type(self):
- cmd_output = json.loads(self.openstack(
- 'configuration show -f json',
+ cmd_output = self.openstack(
+ 'configuration show',
cloud='',
- ))
+ parse_output=True,
+ )
self.assertIsNotNone(cmd_output)
self.assertIn(
'auth_type',
@@ -36,10 +35,11 @@ class ArgumentTests(base.TestCase):
)
def test_auth_type_none(self):
- cmd_output = json.loads(self.openstack(
- 'configuration show -f json',
+ cmd_output = self.openstack(
+ 'configuration show',
cloud=None,
- ))
+ parse_output=True,
+ )
self.assertIsNotNone(cmd_output)
self.assertIn(
'auth_type',
@@ -54,7 +54,7 @@ class ArgumentTests(base.TestCase):
# Make sure token_endpoint is really gone
try:
self.openstack(
- 'configuration show -f json --os-auth-type token_endpoint',
+ 'configuration show --os-auth-type token_endpoint',
cloud=None,
)
except tempest_exc.CommandFailed as e:
@@ -64,10 +64,11 @@ class ArgumentTests(base.TestCase):
self.fail('CommandFailed should be raised')
def test_auth_type_password_opt(self):
- cmd_output = json.loads(self.openstack(
- 'configuration show -f json --os-auth-type password',
+ cmd_output = self.openstack(
+ 'configuration show --os-auth-type password',
cloud=None,
- ))
+ parse_output=True,
+ )
self.assertIsNotNone(cmd_output)
self.assertIn(
'auth_type',