Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2
Revision | bc2efe20de55c9f5855fddbc0082052460fbff99 (tree) |
---|---|
Zeit | 2023-09-20 04:53:21 |
Autor | Albert Mietus < albert AT mietus DOT nl > |
Commiter | Albert Mietus < albert AT mietus DOT nl > |
refactored
@@ -9,10 +9,11 @@ | ||
9 | 9 | from castle.writers import RPy |
10 | 10 | |
11 | 11 | template_dir ="./templates/" |
12 | +t_dir = get_dirPath_of_file(__file__) / template_dir | |
12 | 13 | |
13 | 14 | def test_simpel_template(): |
14 | 15 | HW_file = 'HW_template.txt' |
15 | - t_dir = get_dirPath_of_file(__file__) / template_dir | |
16 | + | |
16 | 17 | |
17 | 18 | template = RPy.Template(searchpath=t_dir, template=HW_file) |
18 | 19 | out=template.render(Hello='{{Hello}}', World='{{World}}') # Generates itself |
@@ -20,3 +21,8 @@ | ||
20 | 21 | ref=open(t_dir / HW_file).read() |
21 | 22 | assert end_with_NL(ref) == end_with_NL(out), f"ref::\n{ref}\nout::\n{out}\nDo not match" |
22 | 23 | |
24 | + | |
25 | +def test_base_child_template(): | |
26 | + child = 'child.txt' | |
27 | + | |
28 | + template = RPy.Template(searchpath=t_dir, template=child) |