This commit is contained in:
bel
2023-09-16 22:30:34 -06:00
commit 6283d7f321
27 changed files with 516 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import unittest
import cdrt
class TestTestdata(unittest.TestCase):
def test(self):
from pathlib import Path
for path in Path('./testdata').rglob('*.yaml'):
doc = cdrt.Doc.from_file(path)
result = doc.render()
print(doc.to_dict())
with open(path, "r") as f:
d = cdrt.yaml_load(f)
if "expect" in d:
print(f'expect "{d["expect"]}", got "{result}"')
self.assertEqual(d["expect"], result)
if __name__ == "__main__":
unittest.main()