Back to index

moin  1.9.0~rc2
Public Member Functions
test_formatter.TestFormatter Class Reference

List of all members.

Public Member Functions

def testSyntaxReferenceDomXml
def testSyntaxReferenceDocBook
def testSyntaxReferenceOthers
def formatPage

Detailed Description

Definition at line 15 of file test_formatter.py.


Member Function Documentation

def test_formatter.TestFormatter.formatPage (   self,
  pagename,
  formatter 
)
Parse a page. Should not raise an exception if the API of the
formatter is correct.

Definition at line 64 of file test_formatter.py.

00064 
00065     def formatPage(self, pagename, formatter):
00066         """Parse a page. Should not raise an exception if the API of the
00067         formatter is correct.
00068         """
00069 
00070         self.request.reset()
00071         page = Page(self.request, pagename, formatter=formatter)
00072         self.request.formatter = page.formatter = formatter(self.request)
00073         self.request.page = page
00074         #page.formatter.setPage(page)
00075         #page.hilite_re = None
00076 
00077         return self.request.redirectedOutput(page.send_page, content_only=1)
00078 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 28 of file test_formatter.py.

00028 
00029     def testSyntaxReferenceDocBook(self):
00030         py.test.skip("docbook is broken")
00031         try:
00032             from xml.dom import getDOMImplementation
00033             dom = getDOMImplementation("4DOM")
00034         except ImportError:
00035             # if we don't have 4suite installed, the docbook formatter would just raise an exception
00036             py.test.skip("not testing docbook formatter because no 4suite installed")
00037         else:
00038             f_name = 'text_docbook'
00039             try:
00040                 formatter = wikiutil.importPlugin(self.request.cfg, "formatter", f_name, "Formatter")
00041             except wikiutil.PluginAttributeError:
00042                 pass
00043             else:
00044                 print "Formatting using %r" % formatter
00045                 self.formatPage("HelpOnMoinWikiSyntax", formatter)
00046                 print "Done."

Here is the call graph for this function:

Definition at line 16 of file test_formatter.py.

00016 
00017     def testSyntaxReferenceDomXml(self):
00018         py.test.skip("domxml <p> generation is broken")
00019         f_name = 'dom_xml'
00020         try:
00021             formatter = wikiutil.importPlugin(self.request.cfg, "formatter", f_name, "Formatter")
00022         except wikiutil.PluginAttributeError:
00023             pass
00024         else:
00025             print "Formatting using %r" % formatter
00026             self.formatPage("HelpOnMoinWikiSyntax", formatter)
00027             print "Done."

Here is the call graph for this function:

Definition at line 47 of file test_formatter.py.

00047 
00048     def testSyntaxReferenceOthers(self):
00049         formatters = wikiutil.getPlugins("formatter", self.request.cfg)
00050 
00051         # we have separate tests for those:
00052         formatters.remove('text_docbook')
00053         formatters.remove('dom_xml')
00054 
00055         for f_name in formatters:
00056             try:
00057                 formatter = wikiutil.importPlugin(self.request.cfg, "formatter", f_name, "Formatter")
00058             except wikiutil.PluginAttributeError:
00059                 pass
00060             else:
00061                 print "Formatting using %r" % formatter
00062                 self.formatPage("HelpOnMoinWikiSyntax", formatter)
00063                 print "Done."

Here is the call graph for this function:


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