Back to index

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

List of all members.

Public Member Functions

def testFirstParagraph
def testEmptyLineBetweenParagraphs
def testParagraphAfterBlockMarkup
def testStrangeP
def parse

Detailed Description

Test paragraphs creating

All tests ignoring white space in output.
We do not test for </p> as it is not there currently.

Definition at line 48 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: empty line separates paragraphs 

Definition at line 60 of file test_text_moin_wiki.py.

00060 
00061     def testEmptyLineBetweenParagraphs(self):
00062         """ parser.wiki: empty line separates paragraphs """
00063         result = self.parse('First\n\nSecond')
00064         assert re.search(r'<p.*?>\s*Second\s*', result)

Here is the call graph for this function:

parser.wiki: first paragraph should be in <p> 

Definition at line 55 of file test_text_moin_wiki.py.

00055 
00056     def testFirstParagraph(self):
00057         """ parser.wiki: first paragraph should be in <p> """
00058         result = self.parse('First')
00059         assert re.search(r'<p.*?>\s*First\s*', result)

Here is the call graph for this function:

parser.wiki: create paragraph after block markup 

Definition at line 65 of file test_text_moin_wiki.py.

00065 
00066     def testParagraphAfterBlockMarkup(self):
00067         """ parser.wiki: create paragraph after block markup """
00068 
00069         markup = (
00070             '----\n',
00071             '|| table ||\n',
00072             '= heading 1 =\n',
00073             '== heading 2 ==\n',
00074             '=== heading 3 ===\n',
00075             '==== heading 4 ====\n',
00076             '===== heading 5 =====\n',
00077             # '<<en>>\n', XXX crashes
00078             )
00079         for item in markup:
00080             text = item + 'Paragraph'
00081             result = self.parse(text)
00082             assert re.search(r'<p.*?>\s*Paragraph\s*', result)

Here is the call graph for this function:

parser.wiki: empty line separates paragraphs 

Definition at line 83 of file test_text_moin_wiki.py.

00083 
00084     def testStrangeP(self):
00085         """ parser.wiki: empty line separates paragraphs """
00086         result = self.parse("""<<BR>> <<BR>>
00087 
00088 foo ''bar'' baz.
00089 """)
00090         assert re.search(r'foo <em>bar</em> baz', result)
00091 

Here is the call graph for this function:


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