diff options
| author | Stephen Finucane <sfinucan@redhat.com> | 2022-11-07 17:21:12 +0000 |
|---|---|---|
| committer | Stephen Finucane <sfinucan@redhat.com> | 2022-11-08 16:39:05 +0000 |
| commit | 38e39b6dc14fd88318541728cb34fd8442d59e8a (patch) | |
| tree | 358f6ffac57759854cba3e3a72a67658c6ba2876 /openstackclient/tests/functional/common/test_args.py | |
| parent | a244bb84e07617dad12dee91bbe63bdca3357b1e (diff) | |
| download | python-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_args.py')
| -rw-r--r-- | openstackclient/tests/functional/common/test_args.py | 25 |
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', |
