[Zope3-checkins] CVS: Zope3/src/zope/app/form/tests - test_utility.py:1.1.2.2 test_widget.py:1.1.2.2
Tim Peters
tim.one@comcast.net
Tue, 24 Dec 2002 21:21:31 -0500
Update of /cvs-repository/Zope3/src/zope/app/form/tests
In directory cvs.zope.org:/tmp/cvs-serv19240/src/zope/app/form/tests
Modified Files:
Tag: NameGeddon-branch
test_utility.py test_widget.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/form/tests/test_utility.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/form/tests/test_utility.py:1.1.2.1 Mon Dec 23 14:31:36 2002
+++ Zope3/src/zope/app/form/tests/test_utility.py Tue Dec 24 21:20:28 2002
@@ -58,7 +58,7 @@
w = W(context, request)
w.custom = 1
return w
-
+
title.__implements__ = IViewFactory
def kw(**kw):
@@ -167,11 +167,11 @@
c = C()
request = TestRequest()
view = BrowserView(c, request)
- view.title = w = W(I['title'], request)
+ view.title = w = W(I['title'], request)
setUpWidget(view, 'title', I['title'], u'yyy')
self.assertEqual(view.title(), u'title: yyy')
self.assertEqual(view.title.getData(), None)
- self.assertEqual(view.title, w)
+ self.assertEqual(view.title, w)
def test_setUpWidget_w_Custom_widget(self):
c = C()
@@ -180,8 +180,8 @@
setUpWidget(view, 'title', I['title'], u'yyy')
self.assertEqual(view.title(), u'title: yyy')
self.assertEqual(view.title.getData(), None)
- self.assertEqual(view.title.custom, 1)
-
+ self.assertEqual(view.title.custom, 1)
+
def test_setupWidgets(self):
c = C()
request = TestRequest()
@@ -189,7 +189,7 @@
setUpWidgets(view, I)
self.assertEqual(view.title(), u'title: ')
self.assertEqual(view.description(), u'description: ')
-
+
def test_setupWidgets_w_prefix(self):
c = C()
request = TestRequest()
@@ -197,17 +197,17 @@
setUpWidgets(view, I, prefix='spam')
self.assertEqual(view.title.prefix, 'spam')
self.assertEqual(view.description.prefix, 'spam')
-
+
def test_setupWidgets_w_initial_data_and_custom_widget(self):
c = C()
request = TestRequest()
view = BrowserView(c, request)
- view.title = w = W(I['title'], request)
+ view.title = w = W(I['title'], request)
setUpWidgets(view, I, initial=kw(title=u"ttt", description=u"ddd"))
self.assertEqual(view.title(), u'title: ttt')
self.assertEqual(view.description(), u'description: ddd')
- self.assertEqual(view.title, w)
-
+ self.assertEqual(view.title, w)
+
def test_setupWidgets_w_initial_data_and_request_data(self):
c = C()
request = TestRequest()
@@ -215,7 +215,7 @@
view = BrowserView(c, request)
setUpWidgets(view, I, initial=kw(title=u"ttt", description=u"ddd"))
self.assertEqual(view.title(), u'title: yyy')
-
+
def test_setupWidgets_w_initial_data_forced_and_request_data(self):
c = C()
request = TestRequest()
@@ -231,11 +231,11 @@
c.description = u'cd'
request = TestRequest()
view = BrowserView(c, request)
- view.title = w = W(I['title'], request)
+ view.title = w = W(I['title'], request)
setUpEditWidgets(view, I)
self.assertEqual(view.title(), u'title: ct')
self.assertEqual(view.description(), u'description: cd')
- self.assertEqual(view.title, w)
+ self.assertEqual(view.title, w)
def test_setupEditWidgets_w_form_data(self):
c = C()
@@ -267,11 +267,11 @@
c.description = u'cd'
request = TestRequest()
view = BrowserView(c, request)
- view.title = w = W(I['title'], request)
+ view.title = w = W(I['title'], request)
setUpEditWidgets(view, I, prefix='eggs')
self.assertEqual(view.title.prefix, 'eggs')
self.assertEqual(view.description.prefix, 'eggs')
- self.assertEqual(view.title, w)
+ self.assertEqual(view.title, w)
def test_setupEditWidgets_w_other_data(self):
c = C()
@@ -286,7 +286,7 @@
setUpEditWidgets(view, I, c2)
self.assertEqual(view.title(), u'title: ct')
self.assertEqual(view.description(), u'description: cd')
-
+
view = BrowserView(c2, request)
setUpEditWidgets(view, I)
self.assertEqual(view.title(), u'title: ct')
@@ -294,13 +294,13 @@
def test_setupEditWidgets_w_bad_data(self):
class Forbidden(AttributeError): pass
-
+
class C(object):
title = u'foo'
def d(self):
raise Forbidden()
-
+
description = property(d)
c = C()
@@ -317,7 +317,7 @@
setUpWidgets(view, I, initial=kw(title=u"ttt", description=u"ddd"))
self.assertEqual(view.title(), u'title: ft')
self.assertEqual(view.description(), u'description: ddd')
-
+
def test_getWidgetsData(self):
c = C()
@@ -365,7 +365,7 @@
view = BrowserView(c, request)
setUpWidgets(view, I, initial=kw(title=u"ttt", description=u"ddd"))
getWidgetsDataForContent(view, I)
-
+
self.assertEqual(c.title, u'ft')
self.assertEqual(c.description, u'fd')
@@ -373,10 +373,10 @@
request.form['field.title'] = u'ftt'
request.form['field.description'] = u'fdd'
getWidgetsDataForContent(view, I, c2)
-
+
self.assertEqual(c.title, u'ft')
self.assertEqual(c.description, u'fd')
-
+
self.assertEqual(c2.title, u'ftt')
self.assertEqual(c2.description, u'fdd')
@@ -389,17 +389,17 @@
view = BrowserView(c, request)
setUpWidgets(view, I2, initial=kw(title=u"ttt", description=u"ddd"))
getWidgetsDataForContent(view, I2)
- self.assertEqual(c.title, u'ft')
- self.assertEqual(c.description, u'old description')
+ self.assertEqual(c.title, u'ft')
+ self.assertEqual(c.description, u'old description')
request = TestRequest()
c.title = u'old title'
view = BrowserView(c, request)
setUpWidgets(view, I2, initial=kw(title=u"ttt", description=u"ddd"))
- self.assertEqual(c.title, u'old title')
- self.assertEqual(c.description, u'old description')
-
-
+ self.assertEqual(c.title, u'old title')
+ self.assertEqual(c.description, u'old description')
+
+
def test_suite():
=== Zope3/src/zope/app/form/tests/test_widget.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/form/tests/test_widget.py:1.1.2.1 Mon Dec 23 14:31:36 2002
+++ Zope3/src/zope/app/form/tests/test_widget.py Tue Dec 24 21:20:28 2002
@@ -58,8 +58,8 @@
self.assertEqual(w.name, 'field.foo')
self.assertEqual(w.width, 60)
verifyObject(IWidget, w)
-
-
+
+
def test_suite():
return TestSuite((