[Zope3-checkins] CVS: Zope3/src/zope/app/content/tests - test_file.py:1.1.2.2

Fred L. Drake, Jr. fred@zope.com
Tue, 24 Dec 2002 09:59:20 -0500


Update of /cvs-repository/Zope3/src/zope/app/content/tests
In directory cvs.zope.org:/tmp/cvs-serv24119

Modified Files:
      Tag: NameGeddon-branch
	test_file.py 
Log Message:
- remove unused import
- misc. cleanup


=== Zope3/src/zope/app/content/tests/test_file.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/content/tests/test_file.py:1.1.2.1	Mon Dec 23 14:31:30 2002
+++ Zope3/src/zope/app/content/tests/test_file.py	Tue Dec 24 09:59:20 2002
@@ -2,33 +2,34 @@
 #
 # 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.
-# 
+#
 ##############################################################################
 """
 
 $Id$
 """
 
-import unittest, ZODB
+import unittest
+
 from zope.interface.verify import verifyClass
 from zope.app.content.file import FileChunk
 
-class Test( unittest.TestCase ):
 
+class Test(unittest.TestCase):
 
     def _makeFile(self, *args, **kw):
         """ """
         from zope.app.content.file import File
 
         return File(*args, **kw)
-        
+
 
     def testEmpty(self):
 
@@ -43,7 +44,7 @@
         file = self._makeFile('Foobar')
         self.assertEqual(file.getContentType(), '')
         self.assertEqual(file.getData(), 'Foobar')
-    
+
 
         file = self._makeFile('Foobar', 'text/plain')
         self.assertEqual(file.getContentType(), 'text/plain')
@@ -58,7 +59,7 @@
     def testMutators(self):
 
         file = self._makeFile()
-        
+
         file.setContentType('text/plain')
         self.assertEqual(file.getContentType(), 'text/plain')
 
@@ -71,7 +72,7 @@
 
 
     def testLargeDataInput(self):
-        
+
         file = self._makeFile()
 
         # Insert as string
@@ -93,15 +94,15 @@
         file.setData(sio)
         self.assertEqual(file.getSize(), 6*100000)
         self.assertEqual(file.getData(), 'Foobar'*100000)
-        
+
 
     def testInterface(self):
-        
+
         from zope.app.content.file import File, IFile
 
         self.failUnless(IFile.isImplementedByInstancesOf(File))
-        self.failUnless(verifyClass(IFile, File))        
-        
+        self.failUnless(verifyClass(IFile, File))
+
 
     def testEdit(self):
         file = self._makeFile()
@@ -112,8 +113,7 @@
 
 
 def test_suite():
-    loader = unittest.TestLoader()
-    return loader.loadTestsFromTestCase( Test )
+    return unittest.makeSuite(Test)
 
 if __name__=='__main__':
-    unittest.TextTestRunner().run( test_suite() )
+    unittest.main(defaultTest='test_suite')