[Zope3-checkins] CVS: Zope3/src/zope/app/publication/tests - test_zopepublication.py:1.1.2.5
Fred L. Drake, Jr.
fred@zope.com
Tue, 24 Dec 2002 02:47:02 -0500
Update of /cvs-repository/Zope3/src/zope/app/publication/tests
In directory cvs.zope.org:/tmp/cvs-serv26002
Modified Files:
Tag: NameGeddon-branch
test_zopepublication.py
Log Message:
minor cleanup, whitespace normalization
=== Zope3/src/zope/app/publication/tests/test_zopepublication.py 1.1.2.4 => 1.1.2.5 ===
--- Zope3/src/zope/app/publication/tests/test_zopepublication.py:1.1.2.4 Mon Dec 23 18:52:34 2002
+++ Zope3/src/zope/app/publication/tests/test_zopepublication.py Tue Dec 24 02:47:01 2002
@@ -23,13 +23,11 @@
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.publisher.interfaces.browser import IBrowserPresentation
-from zope.proxy.context import getWrapperContext
+from zope.proxy.context import getWrapperContext, wrapperTypes
from zope.proxy.introspection import removeAllProxies
from zope.security.checker import defineChecker, NamesChecker
-from zope.proxy.context import wrapperTypes
-
from zope.app.security.registries.principalregistry import principalRegistry
from zope.app.security.grants.principalrolemanager \
import principalRoleManager
@@ -310,7 +308,7 @@
from zodb.storage.mapping import DB
from zope.app.tests.placelesssetup import PlacelessSetup
-from zope.component.adapter import provideAdapter
+from zope.component.adapter import provideAdapter
from zope.interfaces.i18n import IUserPreferredCharsets
@@ -339,11 +337,11 @@
from transaction import get_transaction
class BasePublicationTests(PlacelessSetup, unittest.TestCase):
- klass = ZopePublication
-
+ klass = ZopePublication
+
def setUp(self):
PlacelessSetup.setUp(self)
- provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
+ provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
self.policy = setSecurityPolicy(
SimpleSecurityPolicies.PermissiveSecurityPolicy()
)
@@ -362,7 +360,7 @@
get_transaction().commit()
connection.close()
-
+
from zope.app.traversing.namespaces import provideNamespaceHandler
from zope.app.traversing.presentationnamespaces import view, resource
from zope.app.traversing.etcnamespace import etc
@@ -401,7 +399,7 @@
def getPrincipal(self, id):
return UnauthenticatedPrincipal(id)
-
+
class AuthService2(AuthService1):
@@ -410,12 +408,12 @@
def getPrincipal(self, id):
return Principal(id)
-
+
class ServiceManager:
__implements__ = IServiceService # a dirty lie
-
+
def __init__(self, auth): self.auth = auth
def get(self, key, d=None): return self.auth
__getitem__ = get
@@ -431,7 +429,7 @@
def testPlacefulAuth(self):
principalRegistry.defineDefaultPrincipal('anonymous', '')
-
+
root = self.db.open().root()
app = root[ZopePublication.root_name]
app.setObject('f1', Folder())
@@ -472,9 +470,9 @@
ob = publication.traverseName(request, ob, 'f2')
publication.afterTraversal(request, ob)
self.assertEqual(request.user.getId(), 'test.bob')
-
+
def test_suite():
- return unittest.makeSuite(ZopePublicationTests, 'test')
+ return unittest.makeSuite(ZopePublicationTests)
-if __name__=='__main__':
+if __name__ == '__main__':
unittest.TextTestRunner().run( test_suite() )