]> Devi Nivas Git - chevron.git/commitdiff
Raised coverage to 100%
authornoah morrison <noah@morrison.ph>
Fri, 21 Nov 2014 03:31:14 +0000 (22:31 -0500)
committernoah morrison <noah@morrison.ph>
Fri, 21 Nov 2014 03:31:14 +0000 (22:31 -0500)
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

index c96eb557ad5b3a3691649738002805202a1678ae..d7940cf8e6fad92a1bb9ec62c0cb6ff0b3962b9f 100755 (executable)
@@ -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,