render.py:
` for case in test_cases:
serialised_json = json.dumps(serialize_instance(case), indent=2)
serialised_yaml = yaml.dump(serialize_instance(case), Dumper=yaml.CDumper)
template_definition: Dict
for template_definition in settings['test_templates']:
filename_template: Template = env.from_string(template_definition['dest'])
filename: str = os.path.abspath(filename_template.render(ins=case))
dirname: str = os.path.dirname(filename)
# make sure computed distination path exists
if not os.path.exists(dirname):
os.makedirs(dirname)
with open(filename, 'w') as fh:
if filename[-4:] in ['yaml', '.yml']:
fh.write(serialised_yaml)
else:
fh.write(serialised_json)`
render.py: ` for case in test_cases: serialised_json = json.dumps(serialize_instance(case), indent=2) serialised_yaml = yaml.dump(serialize_instance(case), Dumper=yaml.CDumper)