summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional/volume/v1/test_service.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests/functional/volume/v1/test_service.py')
-rw-r--r--openstackclient/tests/functional/volume/v1/test_service.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/openstackclient/tests/functional/volume/v1/test_service.py b/openstackclient/tests/functional/volume/v1/test_service.py
index fee73f18..7de2de55 100644
--- a/openstackclient/tests/functional/volume/v1/test_service.py
+++ b/openstackclient/tests/functional/volume/v1/test_service.py
@@ -10,8 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import json
-
from openstackclient.tests.functional.volume.v1 import common
@@ -19,18 +17,18 @@ class VolumeServiceTests(common.BaseVolumeTests):
"""Functional tests for volume service."""
def test_volume_service_list(self):
- cmd_output = json.loads(self.openstack(
- 'volume service list -f json'))
+ cmd_output = self.openstack('volume service list', parse_output=True)
# Get the nonredundant services and hosts
services = list(set([x['Binary'] for x in cmd_output]))
# Test volume service list --service
- cmd_output = json.loads(self.openstack(
- 'volume service list -f json ' +
+ cmd_output = self.openstack(
+ 'volume service list ' +
'--service ' +
- services[0]
- ))
+ services[0],
+ parse_output=True,
+ )
for x in cmd_output:
self.assertEqual(
services[0],
@@ -43,9 +41,10 @@ class VolumeServiceTests(common.BaseVolumeTests):
def test_volume_service_set(self):
# Get a service and host
- cmd_output = json.loads(self.openstack(
- 'volume service list -f json'
- ))
+ cmd_output = self.openstack(
+ 'volume service list',
+ parse_output=True,
+ )
service_1 = cmd_output[0]['Binary']
host_1 = cmd_output[0]['Host']
@@ -57,9 +56,10 @@ class VolumeServiceTests(common.BaseVolumeTests):
)
self.assertOutput('', raw_output)
- cmd_output = json.loads(self.openstack(
- 'volume service list -f json --long'
- ))
+ cmd_output = self.openstack(
+ 'volume service list --long',
+ parse_output=True,
+ )
self.assertEqual(
'enabled',
cmd_output[0]['Status']
@@ -77,9 +77,10 @@ class VolumeServiceTests(common.BaseVolumeTests):
)
self.assertOutput('', raw_output)
- cmd_output = json.loads(self.openstack(
- 'volume service list -f json --long'
- ))
+ cmd_output = self.openstack(
+ 'volume service list --long',
+ parse_output=True,
+ )
self.assertEqual(
'disabled',
cmd_output[0]['Status']