[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - TestModule.py:1.1.2.1 TestModuleHookup.py:1.1.2.1 testProtectClass.py:1.1.2.8 testPublicClass.py:1.1.2.8 testmodule.py:NONE testmodulehookup.py:NONE
Jim Fulton
jim@zope.com
Tue, 5 Mar 2002 20:33:44 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/tests
In directory cvs.zope.org:/tmp/cvs-serv22802
Modified Files:
Tag: Zope-3x-branch
testProtectClass.py testPublicClass.py
Added Files:
Tag: Zope-3x-branch
TestModule.py TestModuleHookup.py
Removed Files:
Tag: Zope-3x-branch
testmodule.py testmodulehookup.py
Log Message:
Renamed testmodule and testmodulehookup to be camel case to avoid
having them get sniffed by test runners.
=== Added File Zope3/lib/python/Zope/App/Security/tests/TestModule.py ===
"""This empty module is for containing objects used in the course of tests.
(There is a problem with the way the unit tests interact with the modules
being tests, so the objects can't be expected to show up in place.)"""
=== Added File Zope3/lib/python/Zope/App/Security/tests/TestModuleHookup.py ===
"""Preliminaries to hookup a test suite with the external TestModule.
This is necessary because the test framework interferes with seeing changes in
the running modules via the module namespace. This enables having some
subject classes, instances, permissions, etc, that don't live in the test
modules, themselves."""
from Interface import Interface
PREFIX = "Zope.App.Security.tests.TestModule."
import Zope.App.Security.tests.TestModule as TestModule
TestModule.test_class = None
class I(Interface):
def m1():
pass
def m2():
pass
class I2(I):
def m3():
pass
TestModule.I = I
TestModule.I2 = I2
template_bracket = """<zopeConfigure
xmlns="http://namespaces.zope.org/zope"
xmlns:security='http://namespaces.zope.org/security'>
%s
</zopeConfigure>"""
=== Zope3/lib/python/Zope/App/Security/tests/testProtectClass.py 1.1.2.7 => 1.1.2.8 ===
from cStringIO import StringIO
from Zope.Configuration.xmlconfig import xmlconfig, ZopeXMLConfigurationError
-from testmodulehookup import *
+from TestModuleHookup import *
from Zope.Testing.CleanUp import CleanUp # Base class w registry cleanup
from Zope.App.Security.Exceptions import UndefinedPermissionError
@@ -58,19 +58,19 @@
return "m2"
def m3(self):
return "m3"
- testmodule.test_class = C
- testmodule.test_instance = C()
+ TestModule.test_class = C
+ TestModule.test_instance = C()
self.assertState()
def tearDown(self):
CleanUp.tearDown(self)
- testmodule.test_class = None
+ TestModule.test_class = None
def assertState(self, instP=NOTSET,
m1P=NOTSET, m2P=NOTSET, m3P=NOTSET):
"Verify that class, instance, and methods have expected permissions."
- tclass, instance = testmodule.test_class, testmodule.test_instance
+ tclass, instance = TestModule.test_class, TestModule.test_instance
self.assertEqual(
(
getattr(instance, "__permission__", NOTSET),
=== Zope3/lib/python/Zope/App/Security/tests/testPublicClass.py 1.1.2.7 => 1.1.2.8 ===
from cStringIO import StringIO
from Zope.Configuration.xmlconfig import xmlconfig, ZopeXMLConfigurationError
-from testmodulehookup import *
+from TestModuleHookup import *
NOTSET = []
@@ -45,19 +45,19 @@
return "m2"
def m3(self):
return "m3"
- testmodule.test_class = C
- testmodule.test_instance = C()
+ TestModule.test_class = C
+ TestModule.test_instance = C()
self.assertState()
def tearDown(self):
CleanUp.tearDown(self)
- testmodule.test_class = None
+ TestModule.test_class = None
def assertState(self, instP=NOTSET,
m1P=NOTSET, m2P=NOTSET, m3P=NOTSET):
"Verify that class, instance, and methods have expected permissions."
- tclass, instance = testmodule.test_class, testmodule.test_instance
+ tclass, instance = TestModule.test_class, TestModule.test_instance
self.assertEqual(getattr(instance, "__permission__", NOTSET), instP)
self.assertEqual(getattr(tclass.m1, "__permission__", NOTSET), m1P)
self.assertEqual(getattr(tclass.m2, "__permission__", NOTSET), m2P)
=== Removed File Zope3/lib/python/Zope/App/Security/tests/testmodule.py ===
=== Removed File Zope3/lib/python/Zope/App/Security/tests/testmodulehookup.py ===