Get XSY module mostly feature-complete.
This commit is contained in:
@@ -9,6 +9,8 @@ desc: Unit tests for the AuDaGe XSY module.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
# import time
|
||||
import unittest
|
||||
from importlib import resources
|
||||
|
||||
@@ -17,9 +19,6 @@ import output
|
||||
import assets
|
||||
from AuDaGe.formats.controlexpert.xsy import *
|
||||
|
||||
ASSETS_PATH = "assets"
|
||||
OUTPUT_PATH = "output"
|
||||
|
||||
|
||||
class TestXSY(unittest.TestCase):
|
||||
"""This test case tests the XSYBlock, DataBlock, and Definitions classes in
|
||||
@@ -69,17 +68,22 @@ class TestXSYReader(unittest.TestCase):
|
||||
file_name = os.path.splitext(os.path.split(path)[-1])[0]
|
||||
xsy = self.xsy_reader.read(path, expand=False)
|
||||
xsy.datablock.to_csv(
|
||||
self.out_path.joinpath(f"{file_name}_datablock.csv"), index=False
|
||||
self.out_path.joinpath(f"{file_name}_datablock.csv"),
|
||||
index=False,
|
||||
)
|
||||
xsy.definitions.to_csv(
|
||||
self.out_path.joinpath(f"{file_name}_definitions.csv"), index=False
|
||||
)
|
||||
xsy.datablock.update(xsy.expand_datablock())
|
||||
xsy.datablock.to_csv(
|
||||
self.out_path.joinpath(f"{file_name}_expanded.csv"), index=False
|
||||
self.out_path.joinpath(f"{file_name}_definitions.csv"),
|
||||
index=False,
|
||||
)
|
||||
debug = False
|
||||
for debug_step in XSY.DebugStep if debug else [XSY.DebugStep.NONE]:
|
||||
xsy.expand_datablock(debug_step=debug_step).to_csv(
|
||||
self.out_path.joinpath(
|
||||
f"{file_name}_debug_{debug_step.name}.csv"
|
||||
),
|
||||
index=False,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
__package__ = "test_xsy"
|
||||
unittest.main(failfast=True)
|
||||
|
||||
Reference in New Issue
Block a user