test: use json response

This commit is contained in:
Roman 2025-01-20 14:32:19 +08:00
parent c5f82e6176
commit 01b6025afb
No known key found for this signature in database
GPG Key ID: B8FE070B54E11B75
2 changed files with 5 additions and 6 deletions

View File

@ -28,4 +28,5 @@ class REST(BaseClient):
return self.rest_call("post", "disperse-data", json.dumps(data))
def send_get_range(self, query):
return self.rest_call("post", "da/get-range", json.dumps(query))
response = self.rest_call("post", "da/get-range", json.dumps(query))
return response.json()

View File

@ -28,15 +28,13 @@ class StepsDataAvailability(StepsCommon):
@allure.step
def get_data_range(self, app_id, start, end):
response_bytes = []
response = []
query = prepare_get_range_request(app_id, start, end)
try:
response_bytes = self.node2.send_get_data_range_request(query)
response = self.node2.send_get_data_range_request(query)
except Exception as ex:
assert "Bad Request" in str(ex) or "Internal Server Error" in str(ex)
# Extract data as a string for each index in the received order
parsed_data = []
for item in response_bytes.content:
parsed_data.append(item)
parsed_data = json.loads(response)
return parsed_data