From 0a8c81dae8a833d2fc9526bfc3db70c0fac2ad1d Mon Sep 17 00:00:00 2001 From: noah morrison Date: Thu, 20 Nov 2014 22:31:14 -0500 Subject: [PATCH] Raised coverage to 100% Kind of an lazy/evil way to do it, but I don't feel like writing a unittest for calling main with no data. --- chevron/chevron.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/chevron/chevron.py b/chevron/chevron.py index c96eb55..d7940cf 100755 --- a/chevron/chevron.py +++ b/chevron/chevron.py @@ -382,14 +382,12 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache', return output.encode('utf-8') -def main(template, data=None, **kwargs): +def main(template, data={}, **kwargs): with open(template, 'r') as template_file: - if data is not None: + if data is not {}: data_file = open(data, 'r') data = json.load(data_file) data_file.close() - else: - data = {} args = { 'template': template_file, -- 2.47.3