[Zope3-checkins] CVS: Zope3/src/zope/app/browser/tests - test_absoluteurl.py:1.1.2.4 test_objectname.py:1.1.2.4 test_undo.py:1.1.2.2 test_zodbundomanager.py:1.1.2.2
Tim Peters
tim.one@comcast.net
Tue, 24 Dec 2002 21:21:51 -0500
Update of /cvs-repository/Zope3/src/zope/app/browser/tests
In directory cvs.zope.org:/tmp/cvs-serv19240/src/zope/app/browser/tests
Modified Files:
Tag: NameGeddon-branch
test_absoluteurl.py test_objectname.py test_undo.py
test_zodbundomanager.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/browser/tests/test_absoluteurl.py 1.1.2.3 => 1.1.2.4 ===
--- Zope3/src/zope/app/browser/tests/test_absoluteurl.py:1.1.2.3 Tue Dec 24 13:41:18 2002
+++ Zope3/src/zope/app/browser/tests/test_absoluteurl.py Tue Dec 24 21:20:20 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 AbsoluteURL view
@@ -36,7 +36,7 @@
class Root:
__implements__ = IRoot
-
+
class TrivialContent(object):
"""Trivial content object, used because instances of object are rocks."""
@@ -52,20 +52,20 @@
provideView(IRoot, 'absolute_url', IBrowserPresentation,
[SiteAbsoluteURL])
provideAdapter = getService(None, "Adapters").provideAdapter
- provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
+ provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
def testBadObject(self):
request = TestRequest()
request.setViewType(IBrowserPresentation)
view = getView(None, 'absolute_url', request)
self.assertRaises(TypeError, view.__str__)
-
+
def testNoContext(self):
request = TestRequest()
request.setViewType(IBrowserPresentation)
view = getView(Root(), 'absolute_url', request)
self.assertEqual(str(view), 'http://foobar.com')
-
+
def testBasicContext(self):
request = TestRequest()
request.setViewType(IBrowserPresentation)
@@ -83,7 +83,7 @@
{'name': 'b', 'url': 'http://foobar.com/a/b'},
{'name': 'c', 'url': 'http://foobar.com/a/b/c'},
))
-
+
def testContextWSideEffectsInMiddle(self):
request = TestRequest()
request.setViewType(IBrowserPresentation)
@@ -104,7 +104,7 @@
{'name': 'b', 'url': 'http://foobar.com/a/++skin++ZopeTop/b'},
{'name': 'c', 'url': 'http://foobar.com/a/++skin++ZopeTop/b/c'},
))
-
+
def testContextWSideEffectsInFront(self):
request = TestRequest()
request.setViewType(IBrowserPresentation)
@@ -126,11 +126,10 @@
{'name': 'b', 'url': 'http://foobar.com/++skin++ZopeTop/a/b'},
{'name': 'c', 'url': 'http://foobar.com/++skin++ZopeTop/a/b/c'},
))
-
+
def test_suite():
return makeSuite(Test)
if __name__=='__main__':
main(defaultTest='test_suite')
-
=== Zope3/src/zope/app/browser/tests/test_objectname.py 1.1.2.3 => 1.1.2.4 ===
--- Zope3/src/zope/app/browser/tests/test_objectname.py:1.1.2.3 Tue Dec 24 13:41:18 2002
+++ Zope3/src/zope/app/browser/tests/test_objectname.py Tue Dec 24 21:20:20 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 AbsoluteURL view
@@ -38,7 +38,7 @@
class Root:
__implements__ = IRoot
-
+
class TrivialContent(object):
"""Trivial content object, used because instances of object are rocks."""
@@ -51,22 +51,22 @@
[ObjectNameView])
provideView(IRoot, 'object_name', IBrowserPresentation,
[SiteObjectNameView])
-
+
provideAdapter = getService(None, "Adapters").provideAdapter
- provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
+ provideAdapter(IHTTPRequest, IUserPreferredCharsets, HTTPCharsets)
def testViewBadObject(self):
request = TestRequest()
request.setViewType(IBrowserPresentation)
view = getView(None, 'object_name', request)
self.assertRaises(TypeError, view.__str__)
-
+
def testViewNoContext(self):
request = TestRequest()
request.setViewType(IBrowserPresentation)
view = getView(Root(), 'object_name', request)
self.assertRaises(TypeError, str(view))
-
+
def testViewBasicContext(self):
request = TestRequest()
request.setViewType(IBrowserPresentation)
@@ -76,10 +76,9 @@
content = ContextWrapper(TrivialContent(), content, name='c')
view = getView(content, 'object_name', request)
self.assertEqual(str(view), 'c')
-
+
def test_suite():
return makeSuite(Test)
if __name__=='__main__':
main(defaultTest='test_suite')
-
=== Zope3/src/zope/app/browser/tests/test_undo.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/browser/tests/test_undo.py:1.1.2.1 Tue Dec 24 18:57:59 2002
+++ Zope3/src/zope/app/browser/tests/test_undo.py Tue Dec 24 21:20:20 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.
-#
+#
##############################################################################
"""
@@ -59,12 +59,12 @@
from zope.component import getService
getService(None,'Utilities').provideUtility(IUndoManager,
TestIUndoManager())
-
+
def testGetUndoInfo(self):
view = Undo(None, None)
self.assertEqual(view.getUndoInfo(), TestIUndoManager().getUndoInfo())
-
+
def testUndoSingleTransaction(self):
view = Undo(None, None)
=== Zope3/src/zope/app/browser/tests/test_zodbundomanager.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/browser/tests/test_zodbundomanager.py:1.1.2.1 Tue Dec 24 18:57:59 2002
+++ Zope3/src/zope/app/browser/tests/test_zodbundomanager.py Tue Dec 24 21:20:20 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.
-#
+#
##############################################################################
"""
@@ -56,7 +56,7 @@
um.undoTransaction(('3','4','5'))
expected = testdata
expected = [d for d in expected if (d['id'] not in ('3','4','5'))]
-
+
self.assertEqual(list(um.getUndoInfo()), expected)
def test_suite():