I am writing a unit test for the cpt gef file parser. Because the processing happens external at Viktor, I need to re-create the result object (GEFData). I wrote a result GEFData to a json file. In my unit test, I want to load the json file and re-create the GEFData object. I however get a strange error that I cannot fix. Below is the error, the unittest code and a test json file. Any idea what is happening?
File “viktor\geo.pyx”, line 521, in viktor.geo.GEFData.init
KeyError: ‘headers’
from viktor.geo import GEFData, GEFFile, SoilLayout
import json
with open(Path(__file__).parents[2] / "test_input_data" / "AAHPT-MPT03_gef_data.json", "r") as file:
mocked_gef_data = json.loads(file.read())
mocked_gef_data_object = GEFData(mocked_gef_data)
Test json data
AAHPT-MPT03_gef_data.json (189.7 KB)