fix: add data extraction and decoding

This commit is contained in:
Roman 2025-01-20 13:48:12 +08:00
parent a56dbfc34b
commit b028574a8c
No known key found for this signature in database
GPG Key ID: B8FE070B54E11B75
2 changed files with 10 additions and 2 deletions

View File

@ -26,8 +26,16 @@ class StepsDataAvailability(StepsCommon):
@allure.step
def get_data_range(self, app_id, start, end):
response = []
query = prepare_get_range_request(app_id, start, end)
try:
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 for each index in received order
extracted_data = []
for item in response:
extracted_data.append(item[1])
return extracted_data

View File

@ -15,4 +15,4 @@ class TestDataIntegrity(StepsDataAvailability):
def test_da_sampling_determines_data_presence(self):
self.disperse_data(DATA_TO_DISPERSE[0], [0] * 31 + [1], [0] * 8)
received_data = self.get_data_range([0] * 31 + [1], [0] * 8, [0] * 7 + [5])
assert DATA_TO_DISPERSE[0] == received_data
assert DATA_TO_DISPERSE[0] == received_data[0].decode("utf-8")