Example #1
0
 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
Example #2
0
 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))