[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/Image/tests - testImage.py:1.3
Jeremy Hylton
jeremy@zope.com
Wed, 24 Jul 2002 18:25:34 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/Image/tests
In directory cvs.zope.org:/tmp/cvs-serv22707/Zope/App/OFS/Content/Image/tests
Modified Files:
testImage.py
Log Message:
Code cleanup.
=== Zope3/lib/python/Zope/App/OFS/Content/Image/tests/testImage.py 1.2 => 1.3 ===
import unittest
from Interface.Verify import verifyClass
-class Test( unittest.TestCase ):
-
+class Test(unittest.TestCase):
def _makeImage(self, *args, **kw):
- """ """
from Zope.App.OFS.Content.Image.Image import Image
-
return Image(*args, **kw)
- def testEmpty( self ):
-
+ def testEmpty(self):
file = self._makeImage()
-
self.assertEqual(file.getContentType(), '')
self.assertEqual(file.getData(), None)
-
def testConstructor(self):
-
file = self._makeImage('Data')
self.assertEqual(file.getContentType(), '')
self.assertEqual(file.getData(), 'Data')
-
-
-
def testMutators(self):
-
# XXX What's the point of this test? Does it test that data
# contents override content-type? Or not? If the former, then
# real image data should be used.
@@ -64,19 +53,14 @@
self.assertEqual(file.getContentType(), 'text/html')
self.assertEqual(file.getData(), 'Blah')
-
def testInterface(self):
-
from Zope.App.OFS.Content.Image.Image import Image, IImage
self.failUnless(IImage.isImplementedByInstancesOf(Image))
self.failUnless(verifyClass(IImage, Image))
-
-
def test_suite():
- loader = unittest.TestLoader()
- return loader.loadTestsFromTestCase( Test )
+ return unittest.makeSuite(Test)
if __name__=='__main__':
- unittest.TextTestRunner().run( test_suite() )
+ unittest.TextTestRunner().run(test_suite())