Change two-value client methods to use ResponseBodyData
Note that the image v1 get_image method appears to be unused.
Change-Id: I7fc35a279e85113d203969a3af9e2f2ac3107e53
diff --git a/tempest/api/image/v2/test_images.py b/tempest/api/image/v2/test_images.py
index e307c5c..6b654ca 100644
--- a/tempest/api/image/v2/test_images.py
+++ b/tempest/api/image/v2/test_images.py
@@ -65,8 +65,8 @@
self.assertEqual(1024, body.get('size'))
# Now try get image file
- _, body = self.client.get_image_file(image_id)
- self.assertEqual(file_content, body)
+ body = self.client.get_image_file(image_id)
+ self.assertEqual(file_content, body.data)
@test.attr(type='gate')
def test_delete_image(self):
diff --git a/tempest/api/telemetry/test_telemetry_alarming_api.py b/tempest/api/telemetry/test_telemetry_alarming_api.py
index 05aed08..cb2d2bd 100644
--- a/tempest/api/telemetry/test_telemetry_alarming_api.py
+++ b/tempest/api/telemetry/test_telemetry_alarming_api.py
@@ -80,12 +80,12 @@
# Set alarm state and verify
new_state =\
[elem for elem in alarm_states if elem != alarm['state']][0]
- _, state = self.telemetry_client.alarm_set_state(alarm['alarm_id'],
- new_state)
- self.assertEqual(new_state, state)
+ state = self.telemetry_client.alarm_set_state(alarm['alarm_id'],
+ new_state)
+ self.assertEqual(new_state, state.data)
# Get alarm state and verify
- _, state = self.telemetry_client.alarm_get_state(alarm['alarm_id'])
- self.assertEqual(new_state, state)
+ state = self.telemetry_client.alarm_get_state(alarm['alarm_id'])
+ self.assertEqual(new_state, state.data)
@test.attr(type="gate")
def test_create_delete_alarm_with_combination_rule(self):
diff --git a/tempest/services/image/v1/json/image_client.py b/tempest/services/image/v1/json/image_client.py
index 0c05118..4ea710f 100644
--- a/tempest/services/image/v1/json/image_client.py
+++ b/tempest/services/image/v1/json/image_client.py
@@ -239,8 +239,7 @@
url = 'v1/images/%s' % image_id
resp, body = self.get(url)
self.expected_success(200, resp.status)
- # We can't return a ResponseBody because the body is a string
- return resp, body
+ return service_client.ResponseBodyData(resp, body)
def is_resource_deleted(self, id):
try:
diff --git a/tempest/services/image/v2/json/image_client.py b/tempest/services/image/v2/json/image_client.py
index 4cddc59..50f273c 100644
--- a/tempest/services/image/v2/json/image_client.py
+++ b/tempest/services/image/v2/json/image_client.py
@@ -141,8 +141,7 @@
url = 'v2/images/%s/file' % image_id
resp, body = self.get(url)
self.expected_success(200, resp.status)
- # We can't return a ResponseBody because the body is a string
- return resp, body
+ return service_client.ResponseBodyData(resp, body)
def add_image_tag(self, image_id, tag):
url = 'v2/images/%s/tags/%s' % (image_id, tag)
diff --git a/tempest/services/telemetry/json/telemetry_client.py b/tempest/services/telemetry/json/telemetry_client.py
index dd899e4..a249625 100644
--- a/tempest/services/telemetry/json/telemetry_client.py
+++ b/tempest/services/telemetry/json/telemetry_client.py
@@ -127,7 +127,7 @@
resp, body = self.get(uri)
self.expected_success(200, resp.status)
body = self.deserialize(body)
- return resp, body
+ return service_client.ResponseBodyData(resp, body)
def alarm_set_state(self, alarm_id, state):
uri = "%s/alarms/%s/state" % (self.uri_prefix, alarm_id)
@@ -135,4 +135,4 @@
resp, body = self.put(uri, body)
self.expected_success(200, resp.status)
body = self.deserialize(body)
- return resp, body
+ return service_client.ResponseBodyData(resp, body)