changeset 2173:789c1a37e4ab

don't run docbook formatter test when we have no 4suite installed, add test for non-empty SystemPagesGroup
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 20 Jun 2007 14:32:27 +0200
parents c15ec6a2c69e
children f5f4dbbd0c51
files MoinMoin/_tests/test_formatter.py MoinMoin/_tests/test_wikiutil.py
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_formatter.py	Wed Jun 20 12:15:19 2007 +0200
+++ b/MoinMoin/_tests/test_formatter.py	Wed Jun 20 14:32:27 2007 +0200
@@ -16,9 +16,15 @@
 class TestFormatter(TestCase):
     def testSyntaxReference(self):
         formatters = wikiutil.getPlugins("formatter", self.request.cfg)
+
+        try:
+            from xml.dom import getDOMImplementation
+            dom = getDOMImplementation("4DOM")
+        except ImportError:
+            # if we don't have 4suite installed, the docbook formatter would just raise an exception
+            formatters.remove('text_docbook')
+
         for f_name in formatters:
-            #if f_name in ('dom_xml', ):
-            #    continue
             try:
                 formatter = wikiutil.importPlugin(self.request.cfg, "formatter", f_name, "Formatter")
             except wikiutil.PluginAttributeError:
--- a/MoinMoin/_tests/test_wikiutil.py	Wed Jun 20 12:15:19 2007 +0200
+++ b/MoinMoin/_tests/test_wikiutil.py	Wed Jun 20 14:32:27 2007 +0200
@@ -11,6 +11,10 @@
 from MoinMoin import wikiutil
 
 
+class TestSystemPagesGroup:
+    def testSystemPagesGroupNotEmpty(self):
+        assert self.request.dicts.members('SystemPagesGroup')
+
 class TestSystemPage(unittest.TestCase):
     systemPages = (
         # First level, on SystemPagesGroup