File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -224,3 +224,22 @@ def test_import_export_round_trip(tmp_path: Path) -> None:
224224
225225 nml .save (export_path )
226226 diff_files (snapshot_path , export_path )
227+
228+ def test_volume_dump_round_trip (tmp_path : Path ) -> None :
229+ from webknossos .skeleton .nml import Volume , __dump_volume , __parse_volume
230+ from loxun import XmlWriter
231+ import xml .etree .ElementTree as ET
232+
233+ export_path = tmp_path / "volume_dump.xml"
234+ volume_in = Volume (id = 0 , location = "data_Volume.zip" , fallback_layer = "my_very_important_layer" )
235+ volume_out = None
236+
237+ with open (export_path , 'wb' ) as f :
238+ with XmlWriter (f ) as xf :
239+ __dump_volume (xf , volume_in )
240+
241+ with open (export_path , 'rb' ) as f :
242+ tree = ET .parse (export_path )
243+ volume_out = __parse_volume (next (tree .iter ()))
244+
245+ assert volume_in == volume_out
Original file line number Diff line number Diff line change @@ -382,7 +382,7 @@ def __parse_volume(nml_volume: Element) -> Volume:
382382 return Volume (
383383 int (enforce_not_null (nml_volume .get ("id" ))),
384384 enforce_not_null (nml_volume .get ("location" )),
385- nml_volume .get ("fallback_layer " , default = None ),
385+ nml_volume .get ("fallbackLayer " , default = None ),
386386 )
387387
388388
You can’t perform that action at this time.
0 commit comments