[Zope3-checkins] CVS: Zope3/src/zope/app/traversing/tests - test_acquire.py:1.1.2.3 test_atteritem.py:1.1.2.2 test_conveniencefunctions.py:1.1.2.4 test_etc.py:1.1.2.2 test_objectname.py:1.1.2.3 test_physicallocationadapters.py:1.1.2.3 test_presentation.py:1.1.2.2 test_skin.py:1.1.2.2 test_traverser.py:1.1.2.3
Tim Peters
tim.one@comcast.net
Tue, 24 Dec 2002 21:21:24 -0500
Update of /cvs-repository/Zope3/src/zope/app/traversing/tests
In directory cvs.zope.org:/tmp/cvs-serv19240/src/zope/app/traversing/tests
Modified Files:
Tag: NameGeddon-branch
test_acquire.py test_atteritem.py test_conveniencefunctions.py
test_etc.py test_objectname.py
test_physicallocationadapters.py test_presentation.py
test_skin.py test_traverser.py
Log Message:
Whitespace normalization, via Python's Tools/scripts/reindent.py. The
files are fixed-points of that script now. Fixed a few cases where
code relied on significant trailing whitespace (ouch).
=== Zope3/src/zope/app/traversing/tests/test_acquire.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/traversing/tests/test_acquire.py:1.1.2.2 Mon Dec 23 18:52:37 2002
+++ Zope3/src/zope/app/traversing/tests/test_acquire.py Tue Dec 24 21:20:53 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""
@@ -51,8 +51,8 @@
self.assertRaises(NotFoundError,
acquire, 'a3', (), 'a1;acquire', a211, None)
-
-
+
+
def test_suite():
return makeSuite(Test)
=== Zope3/src/zope/app/traversing/tests/test_atteritem.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/traversing/tests/test_atteritem.py:1.1.2.1 Mon Dec 23 14:32:34 2002
+++ Zope3/src/zope/app/traversing/tests/test_atteritem.py Tue Dec 24 21:20:53 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""
@@ -36,8 +36,8 @@
def testItem(self):
from zope.app.traversing.attritemnamespaces import item
self.assertEqual(item('a', (), 'a;item', c, None), 'avalue')
-
-
+
+
def test_suite():
return makeSuite(Test)
=== Zope3/src/zope/app/traversing/tests/test_conveniencefunctions.py 1.1.2.3 => 1.1.2.4 ===
--- Zope3/src/zope/app/traversing/tests/test_conveniencefunctions.py:1.1.2.3 Mon Dec 23 18:52:37 2002
+++ Zope3/src/zope/app/traversing/tests/test_conveniencefunctions.py Tue Dec 24 21:20:53 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
"""
@@ -54,7 +54,7 @@
root.__implements__ = IContainmentRoot
folder = C('folder')
item = C('item')
-
+
self.root = ContextWrapper(root, None)
self.folder = ContextWrapper(folder, self.root, name='folder')
self.item = ContextWrapper(item, self.folder, name='item')
@@ -82,7 +82,7 @@
traverse(self.item, '/folder/item'),
self.tr.traverse('/folder/item')
)
-
+
def testTraverseFromUnwrapped(self):
from zope.app.traversing import traverse
self.assertRaises(
@@ -101,7 +101,7 @@
traverseName(self.item, '.'),
self.tr.traverse('/folder/item')
)
-
+
def testTraverseNameBadValue(self):
from zope.app.traversing import traverseName
self.assertRaises(
@@ -140,7 +140,7 @@
self.assertEqual(
getParent(self.item),
self.folder
- )
+ )
def testGetParentFromUnwrapped(self):
from zope.app.traversing import getParent
@@ -235,12 +235,12 @@
_good_locations = (
# location returned as string location returned as tuple
- ( u'xx/yy/zz', (u'xx',u'yy',u'zz'),
+ ( u'xx/yy/zz', (u'xx',u'yy',u'zz'),
# arguments to try in addition to the above
('xx','yy','zz'),
'xx/yy/zz',
),
- ( u'/xx/yy/zz', (u'',u'xx',u'yy',u'zz'),
+ ( u'/xx/yy/zz', (u'',u'xx',u'yy',u'zz'),
('','xx','yy','zz'),
'/xx/yy/zz',
_proxied('','xx','yy','zz'),
@@ -265,7 +265,7 @@
correct_answer = spec[1]
for argument in spec:
self.applyAssertEqual(lat, argument, correct_answer)
-
+
def testLocationAsUnicode(self):
from zope.app.traversing import locationAsUnicode as lau
=== Zope3/src/zope/app/traversing/tests/test_etc.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/traversing/tests/test_etc.py:1.1.2.1 Mon Dec 23 14:32:34 2002
+++ Zope3/src/zope/app/traversing/tests/test_etc.py Tue Dec 24 21:20:53 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""
@@ -26,7 +26,7 @@
from zope.app.traversing.etcnamespace import etc
from zope.app.applicationcontrol.applicationcontrol \
import applicationController, applicationControllerRoot
-
+
self.assertEqual(
etc('ApplicationController', (), '++etc++ApplicationController',
applicationControllerRoot, None),
@@ -36,10 +36,10 @@
from zope.app.traversing.etcnamespace import etc
class C:
def getServiceManager(self): return 42
-
+
self.assertEqual(etc('Services', (), 'etc:Services', C(), None), 42)
-
+
def test_suite():
return makeSuite(Test)
=== Zope3/src/zope/app/traversing/tests/test_objectname.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/traversing/tests/test_objectname.py:1.1.2.2 Mon Dec 23 18:52:37 2002
+++ Zope3/src/zope/app/traversing/tests/test_objectname.py Tue Dec 24 21:20:53 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
"""Test the ObjectName adapter
@@ -31,7 +31,7 @@
class Root:
__implements__ = IRoot
-
+
class TrivialContent(object):
"""Trivial content object, used because instances of object are rocks."""
@@ -39,7 +39,7 @@
def setUp(self):
PlacelessSetup.setUp(self)
-
+
provideAdapter = getService(None, "Adapters").provideAdapter
provideAdapter(None, IObjectName, [ObjectName])
provideAdapter(IRoot, IObjectName, [ObjectName])
@@ -47,21 +47,20 @@
def testAdapterBadObject(self):
adapter = getAdapter(None, IObjectName)
self.assertRaises(TypeError, adapter)
-
+
def testAdapterNoContext(self):
adapter = getAdapter(Root(), IObjectName)
self.assertRaises(TypeError, adapter)
-
+
def testAdapterBasicContext(self):
content = ContextWrapper(TrivialContent(), Root(), name='a')
content = ContextWrapper(TrivialContent(), content, name='b')
content = ContextWrapper(TrivialContent(), content, name='c')
adapter = getAdapter(content, IObjectName)
self.assertEqual(adapter(), 'c')
-
+
def test_suite():
return makeSuite(Test)
if __name__=='__main__':
main(defaultTest='test_suite')
-
=== Zope3/src/zope/app/traversing/tests/test_physicallocationadapters.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/traversing/tests/test_physicallocationadapters.py:1.1.2.2 Mon Dec 23 18:52:37 2002
+++ Zope3/src/zope/app/traversing/tests/test_physicallocationadapters.py Tue Dec 24 21:20:53 2002
@@ -45,7 +45,7 @@
self.assertEqual(adapter.getPhysicalPath(), ('', 'f1', 'f2', 'f3'))
self.assertEqual(adapter.getPhysicalRoot(), root)
-
+
adapter = getAdapter(C(), IPhysicallyLocatable)
self.assertRaises(TypeError, adapter.getPhysicalPath)
self.assertRaises(TypeError, adapter.getPhysicalRoot)
@@ -66,7 +66,7 @@
self.assertEqual(adapter.getPhysicalPath(), ('', 'f1', 'f2', 'f3'))
self.assertEqual(adapter.getPhysicalRoot(), root)
-
+
adapter = getAdapter(C(), IPhysicallyLocatable)
self.assertRaises(TypeError, adapter.getPhysicalPath)
self.assertRaises(TypeError, adapter.getPhysicalRoot)
@@ -88,7 +88,7 @@
self.assertEqual(adapter.getPhysicalPath(), ('', 'f1', 'f2', 'f3'))
self.assertEqual(adapter.getPhysicalRoot(), root)
-
+
adapter = getAdapter(C(), IPhysicallyLocatable)
self.assertRaises(TypeError, adapter.getPhysicalPath)
self.assertRaises(TypeError, adapter.getPhysicalRoot)
@@ -98,8 +98,3 @@
if __name__=='__main__':
main(defaultTest='test_suite')
-
-
-
-
-
=== Zope3/src/zope/app/traversing/tests/test_presentation.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/traversing/tests/test_presentation.py:1.1.2.1 Mon Dec 23 14:32:34 2002
+++ Zope3/src/zope/app/traversing/tests/test_presentation.py Tue Dec 24 21:20:53 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""
@@ -37,7 +37,7 @@
class View:
__implements__ = IPresentationType
-
+
def __init__(self, content, request):
self.content = content
@@ -45,7 +45,7 @@
def getPresentationType(self): return IPresentationType
def getPresentationSkin(self): return ''
-
+
class Test(PlacelessSetup, TestCase):
@@ -62,7 +62,7 @@
ob = Content()
r = resource('foo', (), '++resource++foo', ob, Request())
self.assertEqual(r.__class__, Resource)
-
+
def test_suite():
return makeSuite(Test)
=== Zope3/src/zope/app/traversing/tests/test_skin.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/traversing/tests/test_skin.py:1.1.2.1 Mon Dec 23 14:32:34 2002
+++ Zope3/src/zope/app/traversing/tests/test_skin.py Tue Dec 24 21:20:53 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""
=== Zope3/src/zope/app/traversing/tests/test_traverser.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/traversing/tests/test_traverser.py:1.1.2.2 Mon Dec 23 18:52:37 2002
+++ Zope3/src/zope/app/traversing/tests/test_traverser.py Tue Dec 24 21:20:54 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
"""
@@ -175,22 +175,22 @@
self.tr = Traverser(ProxyFactory(root))
def testAllAllowed(self):
- defineChecker(C, Checker(lambda name: CheckerPublic))
+ defineChecker(C, Checker(lambda name: CheckerPublic))
tr = Traverser(ProxyFactory(self.root))
item = self.item
self.assertEquals(tr.traverse(('', 'folder', 'item')), item)
self.assertEquals(tr.traverse(('folder', 'item')), item)
-
+
def testItemDenied(self):
newSecurityManager('no one')
- defineChecker(C, Denied('item'))
+ defineChecker(C, Denied('item'))
tr = Traverser(ProxyFactory(self.root))
folder = self.folder
- self.assertRaises(Unauthorized, tr.traverse,
+ self.assertRaises(Unauthorized, tr.traverse,
('', 'folder', 'item'))
- self.assertRaises(Unauthorized, tr.traverse,
+ self.assertRaises(Unauthorized, tr.traverse,
('folder', 'item'))
self.assertEquals(tr.traverse(('', 'folder')), folder)
self.assertEquals(tr.traverse(('folder', '..', 'folder')),