def test_findCachedLocation(self): t = Template(self.zp) exists = os.path.exists os.path.exists = MagicMock(return_value=True) t.dest_file = 'foo.py' t.tfile = 'foo.py.tmpl' self.source_template = 'foo.tmpl' t.findTemplate() self.assertEqual(t.tfile, t.TemplateCacheLocation()) os.path.exists = exists
def test_templateCacheLocation(self): t = Template(self.zp) t.dest_file = 'foo.py' top = defaults.get('prefix', os.getcwd()) self.assertEqual(t.TemplateCacheLocation(), '%s/%s/Templates/foo.py.tmpl' % (top, DEFAULT_NAME2))