"Fossies" - the Fresh Open Source Software Archive

Member "cheetah3-3.2.6.post2/Cheetah/Tests/Analyzer.py" (20 Apr 2021, 551 Bytes) of package /linux/www/cheetah3-3.2.6.post2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "Analyzer.py": 3-3.2.2_vs_3-3.2.3.

    1 import unittest
    2 
    3 from Cheetah import DirectiveAnalyzer
    4 
    5 
    6 class AnalyzerTests(unittest.TestCase):
    7     def test_set(self):
    8         template = '''
    9         #set $foo = "bar"
   10         Hello ${foo}!
   11         '''
   12         calls = DirectiveAnalyzer.analyze(template)
   13         self.assertEqual(1, calls.get('set'))
   14 
   15     def test_compilersettings(self):
   16         template = '''
   17 #compiler-settings
   18 useNameMapper = False
   19 #end compiler-settings
   20         '''
   21         calls = DirectiveAnalyzer.analyze(template)
   22         self.assertEqual(1, calls.get('compiler-settings'))