Back to index

moin  1.9.0~rc2
Public Member Functions
test_text_moin_wiki.TestRule Class Reference
Inheritance diagram for test_text_moin_wiki.TestRule:
Inheritance graph
[legend]
Collaboration diagram for test_text_moin_wiki.TestRule:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def testNotRule
def testStandardRule
def testVariableRule
def testLongRule
def parse

Detailed Description

Test rules markup 

Definition at line 346 of file test_text_moin_wiki.py.


Member Function Documentation

def test_text_moin_wiki.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_moin_wiki.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         parser = WikiParser(body, request, line_anchors=False)
00043         formatter.startContent('') # needed for _include_stack init
00044         output = request.redirectedOutput(parser.format, formatter)
00045         formatter.endContent('')
00046         return output
00047 

Here is the call graph for this function:

Here is the caller graph for this function:

parser.wiki: ------------ long rule shortened to hr6 

Definition at line 368 of file test_text_moin_wiki.py.

00368 
00369     def testLongRule(self):
00370         """ parser.wiki: ------------ long rule shortened to hr6 """
00371         test = '-' * 254
00372         result = self.parse(test)
00373         assert re.search(r'<hr class="hr6".*?>', result)
00374 

Here is the call graph for this function:

parser.wiki: --- is no rule 

Definition at line 349 of file test_text_moin_wiki.py.

00349 
00350     def testNotRule(self):
00351         """ parser.wiki: --- is no rule """
00352         result = self.parse('---')
00353         expected = '---' # inside <p>
00354         assert expected in result

Here is the call graph for this function:

parser.wiki: ---- is standard rule 

Definition at line 355 of file test_text_moin_wiki.py.

00355 
00356     def testStandardRule(self):
00357         """ parser.wiki: ---- is standard rule """
00358         result = self.parse('----')
00359         assert re.search(r'<hr.*?>', result)

Here is the call graph for this function:

parser.wiki: ----- rules with size 

Definition at line 360 of file test_text_moin_wiki.py.

00360 
00361     def testVariableRule(self):
00362         """ parser.wiki: ----- rules with size """
00363 
00364         for size in range(5, 11):
00365             test = '-' * size
00366             result = self.parse(test)
00367             assert re.search(r'<hr class="hr%d".*?>' % (size - 4), result)

Here is the call graph for this function:


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