[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup/tests -
testStarter.py:1.11
Tres Seaver
tseaver at zope.com
Thu Jan 15 18:05:40 EST 2004
Update of /cvs-repository/Zope/lib/python/Zope/Startup/tests
In directory cvs.zope.org:/tmp/cvs-serv23920/Zope/Startup/tests
Modified Files:
testStarter.py
Log Message:
- Wire up security policy selection machinery to ZConfig (note that the
'C' policy is currently borked, but should be fixed very soon).
=== Zope/lib/python/Zope/Startup/tests/testStarter.py 1.10 => 1.11 ===
--- Zope/lib/python/Zope/Startup/tests/testStarter.py:1.10 Mon Jan 5 10:56:47 2004
+++ Zope/lib/python/Zope/Startup/tests/testStarter.py Thu Jan 15 18:05:09 2004
@@ -22,6 +22,7 @@
import ZConfig
import Zope.Startup
+from Zope.Startup import handlers
from Zope.Startup import ZopeStarter
from App.config import getConfiguration, setConfiguration
@@ -76,7 +77,7 @@
if why == 17:
# already exists
pass
- conf, handler = ZConfig.loadConfigFile(schema, sio)
+ conf, self.handler = ZConfig.loadConfigFile(schema, sio)
self.assertEqual(conf.instancehome, TEMPNAME)
return conf
@@ -361,9 +362,25 @@
pass
setConfiguration(old_config)
+ def testInitializeSecurityOptions(self):
+ from AccessControl import Implementation
+ orig = Implementation.getImplementationName()
+ conf = self.load_config_text("""
+ instancehome <<INSTANCE_HOME>>
+ security-policy-implementation python
+ skip-authentication-checking yes
+ skip-ownership-checking yes
+ """)
+ self.assertEqual(conf.security_policy_implementation, "PYTHON")
+ starter = ZopeStarter(conf)
+ try:
+ starter.setupSecurityOptions()
+ self.assertEqual(Implementation.getImplementationName(), "PYTHON")
+ finally:
+ Implementation.setImplementation(orig)
+
def test_suite():
return unittest.makeSuite(ZopeStarterTestCase)
if __name__ == "__main__":
unittest.main(defaultTest="test_suite")
-
More information about the Zope-Checkins
mailing list