From: noah morrison Date: Fri, 21 Nov 2014 03:31:14 +0000 (-0500) Subject: Raised coverage to 100% X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=0a8c81dae8a833d2fc9526bfc3db70c0fac2ad1d;p=chevron.git 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. --- 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,