root/galaxy-central/eggs/Cheetah-2.2.2-py2.6-macosx-10.6-universal-ucs2.egg/Cheetah/Tests/Cheps.py @ 3

リビジョン 3, 1.1 KB (コミッタ: kohda, 14 年 前)

Install Unix tools  http://hannonlab.cshl.edu/galaxy_unix_tools/galaxy.html

行番号 
1#!/usr/bin/env python
2
3import unittest
4
5import Cheetah
6import Cheetah.Parser
7import Cheetah.Template
8
9class Chep_2_Conditionalized_Import_Behavior(unittest.TestCase):
10    def test_ModuleLevelImport(self):
11        ''' Verify module level (traditional) import behavior '''
12        pass
13
14    def test_InlineImport(self):
15        ''' Verify (new) inline import behavior works '''
16        template = '''
17            #def funky($s)
18                #try
19                    #import urllib
20                #except ImportError
21                    #pass
22                #end try
23                #return urllib.quote($s)
24            #end def
25        '''
26        try:
27            template = Cheetah.Template.Template.compile(template)
28        except Cheetah.Parser.ParseError, ex:
29            self.fail('Failed to properly generate code %s' % ex)
30        template = template()
31        rc = tepmlate.funky('abc def')
32        assert rc == 'abc+def'
33
34    def test_LegacyMode(self):
35        ''' Verify disabling of CHEP #2 works '''
36        pass
37
38if __name__ == '__main__':
39    unittest.main()
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。