gogo
This commit is contained in:
18
design.d/cdrt-experiment.d/test_cdrt.py
Normal file
18
design.d/cdrt-experiment.d/test_cdrt.py
Normal 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()
|
||||
Reference in New Issue
Block a user