diff MoinMoin/request/_tests/test_request.py @ 4027:0d6724b87856

Refactored TestConfig creation for py.test based unit tests. The method used before had multiple problems: config creation did not use inheritance (as it does when used the wiki in production). It also didn't do the post processing done in __init__ of Config class. Also, it first created the request with some default config, then created the TestConfig (but some stuff in request was not initialized correctly)... The new method now uses config inheritance in the same way as a production wiki does. The TestConfig instance is created in RequestBase __init__, it does not use sys.path any more to import the test wikiconfig, but does an absolute import from MoinMoin._tests.wikiconfig. TODO: * fix the failing test_pysupport.TestImportExisting.testExisting * auth tests are currently skipped because they need more work * find a better way than staticmethod(TestConfig)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 24 Aug 2008 02:01:34 +0200
parents 6162f334bd5a
line wrap: on
line diff
--- a/MoinMoin/request/_tests/test_request.py	Fri Aug 22 23:30:38 2008 +0200
+++ b/MoinMoin/request/_tests/test_request.py	Sun Aug 24 02:01:34 2008 +0200
@@ -10,6 +10,7 @@
 import py
 from MoinMoin import config, wikiutil
+from MoinMoin._tests import wikiconfig
 from MoinMoin.request import HeadersAlreadySentException
@@ -73,12 +74,6 @@
 class TestGroupPages(object):
-    def setup_method(self, method):
-        self.config = self.TestConfig(page_group_regex=r'.+Group')
-    def teardown_method(self, method):
-        del self.config
     def testNormalizeGroupName(self):
         """ request: normalize pagename: restrict groups to alpha numeric Unicode