Files
AuDaGe/tests/test_xsy.py
2026-09-14 14:09:10 -05:00

45 lines
1004 B
Python

"""
AuDaGe XSY tests
name: test_xsy.py
by: Josh Lucas
date: 2026-09-14
desc: Unit tests for the AuDaGe XSY module.
"""
import os
import unittest
from timeit import default_timer as timer
# from pandas import DataFrame
from AuDaGe.formats.controlexpert.xsy import XSY
IN_PATH = "tests/assets"
OUT_PATH = "tests/output"
class TestXSY(unittest.TestCase):
def test_init(self):
assert isinstance(XSY(os.path.join(IN_PATH, "hsps.xsy")), XSY)
def test_export(self):
xsy = XSY()
xsy.read(os.path.join(IN_PATH, "hsps.xsy"), expand=False)
xsy.datablock.to_csv(
os.path.join(OUT_PATH, "datablock.csv"),
index=False
)
xsy.definitions.to_csv(
os.path.join(OUT_PATH, "defs.csv"),
index=False
)
# xsy.expand_datablock(datablock).to_csv(
# os.path.join(OUT_PATH, "expanded.csv"),
# index=False
# )
if __name__ == "__main__":
unittest.main(failfast=True)