def test_componentRoot1(): tmpdir=tempfile.mkdtemp() Cfg.load_kw(componentRoot=tmpdir) try: fname=os.path.join(tmpdir, 'index.stml') fp=open(fname, 'w') fp.write('\n'.join([ "<:default kong Chubby:>", "Hello <:val `kong`:>" "<:component /nougat.comp cache=yes:>" ])) fp.close() fp=open(os.path.join(tmpdir, 'nougat.comp'), 'w') fp.write('SERVES YOU RIGHT') fp.close() res=stringcomp('/index.stml', kong='Kong') assert 'Hello Kong' in res finally: Cfg.reset() shutil.rmtree(tmpdir)
def tearDown(self): shutil.rmtree(self.tmpdir) Cfg.reset()
def tearDown(self): shutil.rmtree(self.componentRoot) Cfg.reset()