diff --git a/dotdrop/templategen.py b/dotdrop/templategen.py index e532a5f..d1db7db 100644 --- a/dotdrop/templategen.py +++ b/dotdrop/templategen.py @@ -44,7 +44,8 @@ class Templategen: comment_end_string=COMMENT_END) # adding variables self.env.globals['env'] = os.environ - self.env.globals.update(variables) + if variables: + self.env.globals.update(variables) # adding header method self.env.globals['header'] = self._header # adding helper methods diff --git a/tests/test_compare.py b/tests/test_compare.py index 7bb10be..6c24db4 100644 --- a/tests/test_compare.py +++ b/tests/test_compare.py @@ -46,6 +46,11 @@ class TestCompare(unittest.TestCase): results[path] = diff == '' return results + def test_none(self): + t = Templategen(base=self.CONFIG_DOTPATH, + debug=True, variables=None) + self.assertTrue(t is not None) + def test_compare(self): """Test the compare function""" # setup some directories