Back to index

moin  1.9.0~rc2
Public Member Functions | Static Public Attributes
test_text_creole.TestBlock Class Reference
Inheritance diagram for test_text_creole.TestBlock:
Inheritance graph
[legend]
Collaboration diagram for test_text_creole.TestBlock:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def testParagraphBeforeBlock
def testUrlAfterBlock
def testColorizedPythonParserAndNestingPreBrackets
def testNestingPreBracketsWithLinebreak
def testTextBeforeNestingPreBrackets
def testManyNestingPreBrackets
def testMultipleShortPreSections
def parse

Static Public Attributes

tuple cases

Detailed Description

Definition at line 264 of file test_text_creole.py.


Member Function Documentation

def test_text_creole.ParserTestCase.parse (   self,
  body 
) [inherited]
Parse body and return html

Create a page with body, then parse it and format using html formatter

Definition at line 26 of file test_text_creole.py.

00026 
00027     def parse(self, body):
00028         """Parse body and return html
00029 
00030         Create a page with body, then parse it and format using html formatter
00031         """
00032         request = self.request
00033         assert body is not None
00034         request.reset()
00035         page = Page(request, PAGENAME)
00036         page.hilite_re = None
00037         page.set_raw_body(body)
00038         formatter = HtmlFormatter(request)
00039         formatter.setPage(page)
00040         page.formatter = formatter
00041         request.formatter = formatter
00042         request.page = page
00043         parser = CreoleParser(body, request, line_anchors=False)
00044         formatter.startContent('') # needed for _include_stack init
00045         output = request.redirectedOutput(parser.format, formatter)
00046         formatter.endContent('')
00047         return output
00048 

Here is the call graph for this function:

tests nested {{{ }}} for the python colorized parser

Definition at line 295 of file test_text_creole.py.

00295 
00296     def testColorizedPythonParserAndNestingPreBrackets(self):
00297         """ tests nested {{{ }}} for the python colorized parser
00298         """
00299 
00300         raw = """{{{
00301 #!python
00302 import re
00303 pattern = re.compile(r'{{{This is some nested text}}}')
00304 }}}"""
00305         output = self.parse(raw)
00306         output = ''.join(output)
00307         assert "{{{This is some nested text}}}" in output

Here is the call graph for this function:

tests two nestings  ({{{ }}} and {{{ }}}) in one line for the wiki parser

Definition at line 332 of file test_text_creole.py.

00332 
00333     def testManyNestingPreBrackets(self):
00334         """ tests two nestings  ({{{ }}} and {{{ }}}) in one line for the wiki parser
00335         """
00336 
00337         raw = """{{{
00338 Test {{{brackets}}} and test {{{brackets}}}
00339 }}}"""
00340         output = self.parse(raw)
00341         output = ''.join(output)
00342         expected = '<pre>Test {{{brackets}}} and test {{{brackets}}}'
00343         assert expected in output

Here is the call graph for this function:

tests two single {{{ }}} in one line

Definition at line 344 of file test_text_creole.py.

00344 
00345     def testMultipleShortPreSections(self):
00346         """
00347         tests two single {{{ }}} in one line
00348         """
00349         raw = 'def {{{ghi}}} jkl {{{mno}}}'
00350         output = ''.join(self.parse(raw))
00351         expected = 'def <tt>ghi</tt> jkl <tt>mno</tt>'
00352         assert expected in output

Here is the call graph for this function:

tests nested {{{ }}} for the wiki parser

Definition at line 308 of file test_text_creole.py.

00308 
00309     def testNestingPreBracketsWithLinebreak(self):
00310         """ tests nested {{{ }}} for the wiki parser
00311         """
00312 
00313         raw = """{{{
00314 Example
00315 You can use {{{brackets}}}
00316 }}}"""
00317         output = self.parse(raw)
00318         output = ''.join(output)
00319         print output
00320         assert 'You can use {{{brackets}}}' in output

Here is the call graph for this function:

parser.wiki: paragraph closed before block element 

Definition at line 276 of file test_text_creole.py.

00276 
00277     def testParagraphBeforeBlock(self):
00278         """ parser.wiki: paragraph closed before block element """
00279         text = """AAA
00280 %s
00281 """
00282         for test, blockstart in self.cases:
00283             # We dont test here formatter white space generation
00284             expected = r'<p.*?>AAA\s*</p>\s*%s' % blockstart
00285             needle = re.compile(expected, re.MULTILINE)
00286             result = self.parse(text % test)
00287             assert needle.search(result)

Here is the call graph for this function:

tests text before nested {{{ }}} for the wiki parser

Definition at line 321 of file test_text_creole.py.

00321 
00322     def testTextBeforeNestingPreBrackets(self):
00323         """ tests text before nested {{{ }}} for the wiki parser
00324         """
00325         raw = """Example
00326 {{{
00327 You can use {{{brackets}}}
00328 }}}"""
00329         output = self.parse(raw)
00330         output = ''.join(output)
00331         assert 'Example</p><pre>You can use {{{brackets}}}</pre>' in output

Here is the call graph for this function:

parser.wiki: tests url after block element 

Definition at line 288 of file test_text_creole.py.

00288 
00289     def testUrlAfterBlock(self):
00290         """ parser.wiki: tests url after block element """
00291         case = 'some text {{{some block text\n}}} and a URL http://moinmo.in/'
00292 
00293         result = self.parse(case)
00294         assert result.find('and a URL <a ') > -1

Here is the call graph for this function:


Member Data Documentation

Initial value:
(
        # test, block start
        ('----\n', '<hr'),
        ('= Heading =\n', '<h1'),
        ('{{{\nPre\n}}}\n', '<pre'),
        ('{{{\n#!python\nPre\n}}}\n', '<div'),
        ('| Table |\n', '<div'),
        (' * unordered list\n', '<ul'),
        (' # ordered list\n', '<ol'),
        )

Definition at line 265 of file test_text_creole.py.


The documentation for this class was generated from the following file: