コード例 #1
0
ファイル: test_component.py プロジェクト: smulloni/satimol
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)
コード例 #2
0
ファイル: test_component.py プロジェクト: smulloni/satimol
 def tearDown(self):
     shutil.rmtree(self.tmpdir)
     Cfg.reset()
コード例 #3
0
ファイル: test_layout.py プロジェクト: smulloni/satimol
 def tearDown(self):
     shutil.rmtree(self.componentRoot)
     Cfg.reset()