"Fossies" - the Fresh Open Source Software Archive

Member "cheetah3-3.2.6.post2/Cheetah/Tests/Parser.py" (20 Apr 2021, 1184 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. For more information about "Parser.py" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 3-3.2.2_vs_3-3.2.3.

    1 import unittest
    2 
    3 from Cheetah import Parser
    4 
    5 
    6 class ArgListTest(unittest.TestCase):
    7     def setUp(self):
    8         super(ArgListTest, self).setUp()
    9         self.al = Parser.ArgList()
   10 
   11     def test_merge1(self):
   12         """
   13         Testing the ArgList case results from
   14         Template.Preprocessors.test_complexUsage
   15         """
   16         self.al.add_argument('arg')
   17         expect = [('arg', None)]
   18 
   19         self.assertEqual(expect, self.al.merge())
   20 
   21     def test_merge2(self):
   22         """
   23         Testing the ArgList case results from
   24         SyntaxAndOutput.BlockDirective.test4
   25         """
   26         self.al.add_argument('a')
   27         self.al.add_default('999')
   28         self.al.next()
   29         self.al.add_argument('b')
   30         self.al.add_default('444')
   31 
   32         expect = [(u'a', u'999'), (u'b', u'444')]
   33 
   34         self.assertEqual(expect, self.al.merge())
   35 
   36     def test_merge3(self):
   37         """
   38         Testing the ArgList case results from
   39         SyntaxAndOutput.BlockDirective.test13
   40         """
   41         self.al.add_argument('arg')
   42         self.al.add_default("'This is my block'")
   43         expect = [('arg', "'This is my block'")]
   44 
   45         self.assertEqual(expect, self.al.merge())