def test_scan_template(self, tmpdir): config = SingleConfig() config.template_dir = os.path.realpath( os.path.dirname(os.path.realpath(__file__)) + "../../") config.template = "test-template" doc_generator = Generator({}) print(doc_generator.template_files) assert doc_generator.template_files.sort() == [ 'Readme.md.j2', 'sub_dir/_sample_include.md.j2', 'sub_dir/subdir.md.j2' ].sort()
def test_render(self, tmpdir): config = SingleConfig() config.template_dir = os.path.realpath( os.path.dirname(os.path.realpath(__file__)) + "../../") config.template = "test-template" config.output_dir = str(tmpdir) + "/generated_doc" doc_parser = MocParser() doc_generator = Generator(doc_parser) doc_generator.render() rendered_file = open(str(tmpdir) + "/generated_doc/Readme.md", "r") line = rendered_file.read() print(line)