Back to index

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

List of all members.

Public Member Functions

def testTransclusionFormating
def parse

Static Public Attributes

string text = 'AAA %s AAA'
tuple needle = re.compile(text % r'(.+)')

Static Private Attributes

list _tests

Detailed Description

Test wiki markup 

Definition at line 540 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: transclusion formating 

Definition at line 551 of file test_text_moin_wiki.py.

00551 
00552     def testTransclusionFormating(self):
00553         """ parser.wiki: transclusion formating """
00554         for test, expected in self._tests:
00555             html = self.parse(self.text % test)
00556             result = self.needle.search(html).group(1)
00557             assert result == expected

Here is the call graph for this function:


Member Data Documentation

Initial value:
[
        # test,           expected
        ('{{http://moinmo.in/wiki/common/moinmoin.png}}', '<img alt="http://moinmo.in/wiki/common/moinmoin.png" class="external_image" src="http://moinmo.in/wiki/common/moinmoin.png" title="http://moinmo.in/wiki/common/moinmoin.png" />'),
        ('{{http://moinmo.in/wiki/common/moinmoin.png|moin logo}}', '<img alt="moin logo" class="external_image" src="http://moinmo.in/wiki/common/moinmoin.png" title="moin logo" />'),
        ]

Definition at line 545 of file test_text_moin_wiki.py.

tuple test_text_moin_wiki.TestTransclusionMarkup.needle = re.compile(text % r'(.+)') [static]

Definition at line 544 of file test_text_moin_wiki.py.

string test_text_moin_wiki.TestTransclusionMarkup.text = 'AAA %s AAA' [static]

Definition at line 543 of file test_text_moin_wiki.py.


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