mirror of
https://github.com/logos-blockchain/logos-blockchain-e2e-tests.git
synced 2026-01-04 06:03:12 +00:00
fix: add data extraction and decoding
This commit is contained in:
parent
a56dbfc34b
commit
b028574a8c
@ -26,8 +26,16 @@ class StepsDataAvailability(StepsCommon):
|
|||||||
|
|
||||||
@allure.step
|
@allure.step
|
||||||
def get_data_range(self, app_id, start, end):
|
def get_data_range(self, app_id, start, end):
|
||||||
|
response = []
|
||||||
query = prepare_get_range_request(app_id, start, end)
|
query = prepare_get_range_request(app_id, start, end)
|
||||||
try:
|
try:
|
||||||
self.node2.send_get_data_range_request(query)
|
response = self.node2.send_get_data_range_request(query)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
assert "Bad Request" in str(ex) or "Internal Server Error" in str(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
|
||||||
|
|||||||
@ -15,4 +15,4 @@ class TestDataIntegrity(StepsDataAvailability):
|
|||||||
def test_da_sampling_determines_data_presence(self):
|
def test_da_sampling_determines_data_presence(self):
|
||||||
self.disperse_data(DATA_TO_DISPERSE[0], [0] * 31 + [1], [0] * 8)
|
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])
|
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")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user