[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form/tests - test_add.py:1.10 test_checkboxwidget.py:1.6 test_editview.py:1.7 test_filewidget.py:1.4 test_listwidget.py:1.5 test_multicheckboxwidget.py:1.5 test_multilistwidget.py:1.5 test_passwordwidget.py:1.5 test_radiowidget.py:1.6 test_setprefix.py:1.4 test_textareawidget.py:1.5

Fred L. Drake, Jr. fred@zope.com
Tue, 8 Apr 2003 17:34:23 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/form/tests
In directory cvs.zope.org:/tmp/cvs-serv15824/src/zope/app/browser/form/tests

Modified Files:
	test_add.py test_checkboxwidget.py test_editview.py 
	test_filewidget.py test_listwidget.py 
	test_multicheckboxwidget.py test_multilistwidget.py 
	test_passwordwidget.py test_radiowidget.py test_setprefix.py 
	test_textareawidget.py 
Log Message:
- change imports to avoid importing unused names
- normalize whitespace


=== Zope3/src/zope/app/browser/form/tests/test_add.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/browser/form/tests/test_add.py:1.9	Tue Mar 25 07:21:11 2003
+++ Zope3/src/zope/app/browser/form/tests/test_add.py	Tue Apr  8 17:34:22 2003
@@ -17,7 +17,8 @@
 """
 
 import sys
-from unittest import TestCase, TestSuite, main, makeSuite
+import unittest
+
 from zope.app.browser.form.add import add, AddViewFactory, AddView
 from zope.interface import Interface
 from zope.schema import TextLine
@@ -33,13 +34,13 @@
 class Context:
 
     def resolve(self, name):
-        l = name.rfind('.') 
+        l = name.rfind('.')
         if l >= 0:
             # eek, we got a real dotted name
             m = sys.modules[name[:l]]
             return getattr(m, name[l+1:])
-            
-            
+
+
         return globals()[name]
 
 class I(Interface):
@@ -83,7 +84,7 @@
     extra1 = u"extra1"
     extra2 = u"extra2"
 
-class Test(PlacelessSetup, TestCase):
+class Test(PlacelessSetup, unittest.TestCase):
 
     def _invoke_add(self, schema="I", name="addthis", permission="zope.Public",
                     label="Add this", content_factory="C", class_="V",
@@ -227,9 +228,9 @@
         [(descriminator, callable, args, kw)] = self._invoke_add()
         factory = AddViewFactory(*args)
         request = TestRequest()
-        
+
         request.form.update(dict([
-            ("field.%s" % k, v) 
+            ("field.%s" % k, v)
             for (k, v) in dict(SampleData.__dict__).items()
             ]))
         request.form[Update] = ''
@@ -248,13 +249,13 @@
                  'foo': 'foo',
                  })
             return ob
-        
+
         V.add = add
 
         V.nextURL = lambda self: 'next'
 
         try:
-            
+
             self.assertEqual(view.update(), '')
 
             self.assertEqual(view.errors, ())
@@ -276,12 +277,10 @@
             # Uninstall hooks
             del V.add
             del V.nextURL
-            
+
 
 def test_suite():
-    return TestSuite((
-        makeSuite(Test),
-        ))
+    return unittest.makeSuite(Test)
 
 if __name__=='__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')


=== Zope3/src/zope/app/browser/form/tests/test_checkboxwidget.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/form/tests/test_checkboxwidget.py:1.5	Mon Jan 20 11:23:38 2003
+++ Zope3/src/zope/app/browser/form/tests/test_checkboxwidget.py	Tue Apr  8 17:34:22 2003
@@ -14,7 +14,8 @@
 """
 $Id$
 """
-from unittest import TestCase, TestSuite, main, makeSuite
+import unittest
+
 from zope.app.browser.form.widget import CheckBoxWidget
 from zope.schema import Bool
 
@@ -63,7 +64,7 @@
 
 
 def test_suite():
-    return makeSuite(CheckBoxWidgetTest)
+    return unittest.makeSuite(CheckBoxWidgetTest)
 
 if __name__=='__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')


=== Zope3/src/zope/app/browser/form/tests/test_editview.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/browser/form/tests/test_editview.py:1.6	Fri Mar 21 15:57:44 2003
+++ Zope3/src/zope/app/browser/form/tests/test_editview.py	Tue Apr  8 17:34:22 2003
@@ -13,7 +13,8 @@
 ##############################################################################
 """$Id$
 """
-from unittest import TestCase, TestSuite, main, makeSuite
+import unittest
+
 from zope.app.tests.placelesssetup import PlacelessSetup
 from zope.app.event.tests.placelesssetup import getEvents
 from zope.interface import Interface
@@ -22,8 +23,7 @@
 from zope.publisher.browser import TestRequest
 from zope.publisher.interfaces.browser import IBrowserPresentation
 from zope.app.browser.form.editview import EditView
-from zope.component.view \
-     import provideView, setDefaultViewName
+from zope.component.view import provideView, setDefaultViewName
 from zope.app.browser.form.widget import TextWidget
 from zope.app.browser.form.submit import Update
 
@@ -48,7 +48,7 @@
 class NonConforming(C):
     __implements__ = ()
 
-class Test(PlacelessSetup, TestCase):
+class Test(PlacelessSetup, unittest.TestCase):
 
     def setUp(self):
         PlacelessSetup.setUp(self)
@@ -164,13 +164,11 @@
         self.assertEqual(c.b  , u'c b')
         self.assertEqual(c.baz, u'c baz')
 
-        
+
 
 
 def test_suite():
-    return TestSuite((
-        makeSuite(Test),
-        ))
+    return unittest.makeSuite(Test)
 
 if __name__=='__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')


=== Zope3/src/zope/app/browser/form/tests/test_filewidget.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/form/tests/test_filewidget.py:1.3	Wed Jan 15 10:44:33 2003
+++ Zope3/src/zope/app/browser/form/tests/test_filewidget.py	Tue Apr  8 17:34:22 2003
@@ -14,9 +14,10 @@
 """
 $Id$
 """
-from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app.browser.form.widget import FileWidget
+import unittest
+
 from StringIO import StringIO
+from zope.app.browser.form.widget import FileWidget
 
 from zope.app.browser.form.tests.test_browserwidget import BrowserWidgetTest
 
@@ -54,7 +55,7 @@
 
 
 def test_suite():
-    return makeSuite(FileWidgetTest)
+    return unittest.makeSuite(FileWidgetTest)
 
 if __name__=='__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')


=== Zope3/src/zope/app/browser/form/tests/test_listwidget.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/form/tests/test_listwidget.py:1.4	Thu Feb 20 09:45:44 2003
+++ Zope3/src/zope/app/browser/form/tests/test_listwidget.py	Tue Apr  8 17:34:22 2003
@@ -14,9 +14,9 @@
 """
 $Id$
 """
-from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app.browser.form.widget import ListWidget
+import unittest
 
+from zope.app.browser.form.widget import ListWidget
 from zope.app.browser.form.tests.test_browserwidget import BrowserWidgetTest
 
 class ListWidgetTest(BrowserWidgetTest):
@@ -70,7 +70,7 @@
 
 
 def test_suite():
-    return makeSuite(ListWidgetTest)
+    return unittest.makeSuite(ListWidgetTest)
 
 if __name__=='__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')


=== Zope3/src/zope/app/browser/form/tests/test_multicheckboxwidget.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/form/tests/test_multicheckboxwidget.py:1.4	Thu Feb 20 09:45:44 2003
+++ Zope3/src/zope/app/browser/form/tests/test_multicheckboxwidget.py	Tue Apr  8 17:34:22 2003
@@ -14,9 +14,9 @@
 """
 $Id$
 """
-from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app.browser.form.widget import MultiCheckBoxWidget
+import unittest
 
+from zope.app.browser.form.widget import MultiCheckBoxWidget
 from zope.app.browser.form.tests.test_browserwidget import BrowserWidgetTest
 
 class MultiCheckBoxWidgetTest(BrowserWidgetTest):
@@ -70,7 +70,7 @@
 
 
 def test_suite():
-    return makeSuite(MultiCheckBoxWidgetTest)
+    return unittest.makeSuite(MultiCheckBoxWidgetTest)
 
 if __name__=='__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')


=== Zope3/src/zope/app/browser/form/tests/test_multilistwidget.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/form/tests/test_multilistwidget.py:1.4	Thu Feb 20 09:45:44 2003
+++ Zope3/src/zope/app/browser/form/tests/test_multilistwidget.py	Tue Apr  8 17:34:22 2003
@@ -14,9 +14,9 @@
 """
 $Id$
 """
-from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app.browser.form.widget import MultiListWidget
+import unittest
 
+from zope.app.browser.form.widget import MultiListWidget
 from zope.app.browser.form.tests.test_browserwidget import BrowserWidgetTest
 
 class MultiListWidgetTest(BrowserWidgetTest):
@@ -69,7 +69,7 @@
 
 
 def test_suite():
-    return makeSuite(MultiListWidgetTest)
+    return unittest.makeSuite(MultiListWidgetTest)
 
 if __name__=='__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')


=== Zope3/src/zope/app/browser/form/tests/test_passwordwidget.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/form/tests/test_passwordwidget.py:1.4	Mon Feb 24 09:50:44 2003
+++ Zope3/src/zope/app/browser/form/tests/test_passwordwidget.py	Tue Apr  8 17:34:22 2003
@@ -14,9 +14,9 @@
 """
 $Id$
 """
-from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app.browser.form.widget import PasswordWidget
+import unittest
 
+from zope.app.browser.form.widget import PasswordWidget
 from zope.app.browser.form.tests.test_browserwidget import BrowserWidgetTest
 
 
@@ -43,7 +43,7 @@
         self.assertRaises(NotImplementedError, self._widget.hidden)
 
 def test_suite():
-    return makeSuite(PasswordWidgetTest)
+    return unittest.makeSuite(PasswordWidgetTest)
 
 if __name__=='__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')


=== Zope3/src/zope/app/browser/form/tests/test_radiowidget.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/form/tests/test_radiowidget.py:1.5	Fri Apr  4 10:39:29 2003
+++ Zope3/src/zope/app/browser/form/tests/test_radiowidget.py	Tue Apr  8 17:34:22 2003
@@ -14,9 +14,9 @@
 """
 $Id$
 """
-from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app.browser.form.widget import RadioWidget
+import unittest
 
+from zope.app.browser.form.widget import RadioWidget
 from zope.app.browser.form.tests.test_browserwidget import BrowserWidgetTest
 
 class RadioWidgetTest(BrowserWidgetTest):
@@ -101,7 +101,7 @@
                               '</div>' % (id, label, id, value))
 
 def test_suite():
-    return makeSuite(RadioWidgetTest)
+    return unittest.makeSuite(RadioWidgetTest)
 
 if __name__=='__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')


=== Zope3/src/zope/app/browser/form/tests/test_setprefix.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/form/tests/test_setprefix.py:1.3	Wed Jan 15 10:44:33 2003
+++ Zope3/src/zope/app/browser/form/tests/test_setprefix.py	Tue Apr  8 17:34:22 2003
@@ -14,14 +14,15 @@
 """
 $Id$
 """
-from unittest import TestCase, TestSuite, main, makeSuite
+import unittest
+
 from zope.app.browser.form.widget import TextWidget
 from zope.publisher.browser import TestRequest
 from zope.app.browser.form.tests.test_browserwidget import BrowserWidgetTest
 from zope.schema import Text
 
 
-class Test(TestCase):
+class Test(unittest.TestCase):
 
     def setUp(self):
         field = Text(__name__ = 'foo')
@@ -53,7 +54,7 @@
 
 
 def test_suite():
-    return makeSuite(Test)
+    return unittest.makeSuite(Test)
 
 if __name__=='__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')


=== Zope3/src/zope/app/browser/form/tests/test_textareawidget.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/form/tests/test_textareawidget.py:1.4	Thu Jan 16 14:50:30 2003
+++ Zope3/src/zope/app/browser/form/tests/test_textareawidget.py	Tue Apr  8 17:34:22 2003
@@ -14,9 +14,9 @@
 """
 $Id$
 """
-from unittest import TestCase, TestSuite, main, makeSuite
-from zope.app.browser.form.widget import TextAreaWidget
+import unittest
 
+from zope.app.browser.form.widget import TextAreaWidget
 from zope.app.browser.form.tests.test_browserwidget import BrowserWidgetTest
 
 
@@ -55,7 +55,7 @@
 
 
 def test_suite():
-    return makeSuite(TextAreaWidgetTest)
+    return unittest.makeSuite(TextAreaWidgetTest)
 
 if __name__=='__main__':
-    main(defaultTest='test_suite')
+    unittest.main(defaultTest='test_suite')