Show
Ignore:
Timestamp:
09/12/08 11:49:04 (18 months ago)
Author:
JensDiemer
Message:
  • Add a new sourcecode blocktag
  • update creole markup:
    • Add a passthrough for all django template blocktags
    • Update unittests (needs more)
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid_project/tests/markup_creole.py

    r1761 r1763  
    4545        document = Parser(txt).parse() 
    4646        out_string = HtmlEmitter(document).emit() 
    47         print ">>>%r<<<" % out_string 
     47        #print ">>>%r<<<" % out_string 
    4848        return out_string 
    4949     
     
    116116            no image: {{ foo|bar }}! 
    117117            picture [[www.domain.tld | {{ foo.JPG | Foo }} ]] as a link 
    118  
    119118        """, """ 
    120119            <p>The current page name: &gt;{{ PAGE.name }}&lt; great? <br /> 
     
    128127        """) 
    129128         
     129    def test_nowiki1(self): 
     130        """ 
     131        Test preformatted text 
     132        """ 
     133        self.assertCreole(r""" 
     134            {{{ 
     135            //This// does **not** get [[formatted]] 
     136            }}} 
     137        """, """ 
     138            <pre> 
     139            //This// does **not** get [[formatted]] 
     140            </pre> 
     141        """) 
     142         
     143    def test_nowiki2(self): 
     144        """ 
     145        Test preformatted text 
     146        """ 
     147        self.assertCreole(r""" 
     148            111 
     149            222 
     150             
     151            {{{ 
     152            333 
     153            }}} 
     154             
     155            444 
     156        """, """ 
     157            <p>111 <br /> 
     158            222 </p> 
     159             
     160            <pre> 
     161            333 
     162            </pre> 
     163            <p>444 </p> 
     164        """) 
     165     
    130166    def test_preformatted(self): 
    131167        """ 
     
    133169        """ 
    134170        self.assertCreole(r""" 
    135             == preformatted 
     171            This should be also interpreded as preformated: 
    136172             
    137             {{{ 
    138             == [[NoWiki]]: 
    139             //**don't** format// 
     173            {% sourcecode py %} 
     174            import sys 
    140175             
    141             {{ PAGE.name }} 
    142             }}} 
    143             OK? 
     176            sys.stdout("Hello World!") 
     177            {% endsourcecode %} 
     178             
     179            END 
    144180        """, """ 
    145             <h2>preformatted</h2> 
    146             <pre>== [[NoWiki]]: 
    147             //**don't** format// 
     181            <p>This should be also interpreded as preformated: </p> 
    148182             
    149             {{ PAGE.name }}</pre><p>OK? </p> 
     183            {% sourcecode py %} 
     184            import sys 
     185             
     186            sys.stdout("Hello World!") 
     187            {% endsourcecode %} 
     188             
     189            <p>END </p> 
    150190        """) 
     191 
    151192 
    152193