Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions moban/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def handle_command_line(options):
options[constants.LABEL_CONFIG],
options[constants.LABEL_OUTPUT],
)
engine.report()
HASH_STORE.save_hashes()
exit_code = reporter.convert_to_shell_exit_code(
engine.number_of_templated_files()
Expand Down
2 changes: 2 additions & 0 deletions moban/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def number_of_templated_files(self):
return self.templated_count

def render_to_file(self, template_file, data_file, output_file):
self.file_count = 1
data = self.context.get_data(data_file)
template = self.engine.get_template(template_file)
template_abs_path = utils.get_template_path(
Expand All @@ -56,6 +57,7 @@ def render_to_file(self, template_file, data_file, output_file):
)
if flag:
reporter.report_templating(template_file, output_file)
self.templated_count += 1

def apply_template(self, template_abs_path, template, data, output_file):
rendered_content = self.engine.apply_template(
Expand Down
5 changes: 4 additions & 1 deletion tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,10 @@ def _moban(self, folder, expected):
def _raw_moban(self, args, folder, expected, output):
os.chdir(os.path.join("docs", folder))
with patch.object(sys, "argv", args):
main()
try:
main()
except SystemExit as e:
eq_("1", str(e))
_verify_content(output, expected)
os.unlink(output)

Expand Down