changeset 4029:3d5c4ebe8f34

tests: do not use TestConfig class name because py.test thinks that is a test
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 24 Aug 2008 16:35:51 +0200
parents 5c78ac77c98f
children 8a1c8fb7c689 68951e8e069d
files MoinMoin/_tests/_test_template.py MoinMoin/auth/_tests/test_auth.py MoinMoin/auth/_tests/test_ldap_login.py MoinMoin/conftest.py MoinMoin/security/_tests/test_security.py
diffstat 5 files changed, 13 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/_test_template.py	Sun Aug 24 16:01:27 2008 +0200
+++ b/MoinMoin/_tests/_test_template.py	Sun Aug 24 16:35:51 2008 +0200
@@ -46,9 +46,8 @@
     )
 
     from MoinMoin._tests import wikiconfig
-    class TestConfig(wikiconfig.Config):
+    class Config(wikiconfig.Config):
         foo = 'bar'  # we want to have this non-default setting
-    TestConfig = staticmethod(TestConfig)
 
     def setup_class(self):
         """ Stuff that should be run to init the state of this test class
--- a/MoinMoin/auth/_tests/test_auth.py	Sun Aug 24 16:01:27 2008 +0200
+++ b/MoinMoin/auth/_tests/test_auth.py	Sun Aug 24 16:35:51 2008 +0200
@@ -7,7 +7,7 @@
 """
 
 import py.test
-py.test.skip("broken due to TestConfig replacement, fix later")
+py.test.skip("broken due to test Config refactoring, fix later")
 
 import StringIO, urllib
 
@@ -92,9 +92,8 @@
         assert '</html>' in output
 
 class TestAnonSession(AuthTest):
-    class TestConfig(wikiconfig.Config):
+    class Config(wikiconfig.Config):
         anonymous_session_lifetime = 1
-    TestConfig = staticmethod(TestConfig)
 
     def testAnonSession(self):
         """ run some requests, no auth, check if anon sessions work """
@@ -155,11 +154,10 @@
             assert trail == trail_expected
 
 class TestHttpAuthSession(AuthTest):
-    class TestConfig(wikiconfig.Config):
+    class Config(wikiconfig.Config):
         from MoinMoin.auth.http import HTTPAuth
         auth = [HTTPAuth()]
         user_autocreate = True
-    TestConfig = staticmethod(TestConfig)
 
     def testHttpAuthSession(self):
         """ run some requests with http auth, check whether session works """
@@ -220,10 +218,9 @@
             assert trail == trail_expected
 
 class TestMoinAuthSession(AuthTest):
-    class TestConfig(wikiconfig.Config):
+    class Config(wikiconfig.Config):
         from MoinMoin.auth import MoinAuth
         auth = [MoinAuth()]
-    TestConfig = staticmethod(TestConfig)
 
     def testMoinAuthSession(self):
         """ run some requests with MoinAuth, check whether session works """
--- a/MoinMoin/auth/_tests/test_ldap_login.py	Sun Aug 24 16:01:27 2008 +0200
+++ b/MoinMoin/auth/_tests/test_ldap_login.py	Sun Aug 24 16:35:51 2008 +0200
@@ -7,7 +7,7 @@
 """
 
 import py.test
-py.test.skip("Broken due to TestConfig refactoring")
+py.test.skip("Broken due to test Config refactoring")
 
 from MoinMoin._tests.ldap_testbase import LDAPTstBase, LdapEnvironment, check_environ, SLAPD_EXECUTABLE
 from MoinMoin._tests.ldap_testdata import *
@@ -47,7 +47,7 @@
     slapd_config = SLAPD_CONFIG
     ldif_content = LDIF_CONTENT
 
-    class TestConfig(wikiconfig.Config):
+    class Config(wikiconfig.Config):
         from MoinMoin.auth.ldap_login import LDAPAuth
         server_uri = self.ldap_env.slapd.url # XXX no self
         base_dn = self.ldap_env.basedn
@@ -90,7 +90,7 @@
     slapd_config = SLAPD_CONFIG
     ldif_content = LDIF_CONTENT
 
-    class TestConfig(wikiconfig.Config):
+    class Config(wikiconfig.Config):
         from MoinMoin.auth.ldap_login import LDAPAuth
         from MoinMoin.auth import MoinAuth
         server_uri = self.ldap_env.slapd.url # XXX no self
@@ -184,7 +184,7 @@
     slapd_config = SLAPD_CONFIG
     ldif_content = LDIF_CONTENT
 
-    class TestConfig(wikiconfig.Config):
+    class Config(wikiconfig.Config):
         from MoinMoin.auth.ldap_login import LDAPAuth
         authlist = []
         for ldap_env in self.ldap_envs: # XXX no self
--- a/MoinMoin/conftest.py	Sun Aug 24 16:01:27 2008 +0200
+++ b/MoinMoin/conftest.py	Sun Aug 24 16:35:51 2008 +0200
@@ -12,7 +12,7 @@
 classes by the framework.
 
 Tests that require a certain configuration, like section_numbers = 1, must
-use a TestConfig to create the required configuration before the test.
+use a Config class to define the required configuration within the test class.
 
 @copyright: 2005 MoinMoin:NirSoffer,
             2007 MoinMoin:AlexanderSchremmer,
@@ -97,8 +97,8 @@
 
     def setup(self):
         cls = self.obj
-        if hasattr(cls, 'TestConfig'):
-            cls.request = init_test_request(given_config=cls.TestConfig)
+        if hasattr(cls, 'Config'):
+            cls.request = init_test_request(given_config=cls.Config)
         else:
             cls.request = self.parent.request
         super(MoinClassCollector, self).setup()
--- a/MoinMoin/security/_tests/test_security.py	Sun Aug 24 16:01:27 2008 +0200
+++ b/MoinMoin/security/_tests/test_security.py	Sun Aug 24 16:35:51 2008 +0200
@@ -252,12 +252,11 @@
     ]
 
     from MoinMoin._tests import wikiconfig
-    class TestConfig(wikiconfig.Config):
+    class Config(wikiconfig.Config):
         acl_rights_before = u"WikiAdmin:admin,read,write,delete,revert"
         acl_rights_default = u"All:read,write"
         acl_rights_after = u"All:read"
         acl_hierarchic = False
-    TestConfig = staticmethod(TestConfig)
 
     def setup_class(self):
         # Backup user