[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/file/tests/test_image.py Use real image data and give the test soem meaning.

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Jul 8 18:30:23 EDT 2004


Log message for revision 26252:
Use real image data and give the test soem meaning.



-=-
Modified: Zope3/trunk/src/zope/app/file/tests/test_image.py
===================================================================
--- Zope3/trunk/src/zope/app/file/tests/test_image.py	2004-07-08 22:29:53 UTC (rev 26251)
+++ Zope3/trunk/src/zope/app/file/tests/test_image.py	2004-07-08 22:30:23 UTC (rev 26252)
@@ -57,23 +57,16 @@
         self.assertEqual(file.data, '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.
+        image = self._makeImage()
 
-        file = self._makeImage()
+        image.contentType = 'image/jpeg'
+        self.assertEqual(image.contentType, 'image/jpeg')
 
-        file.contentType = 'text/plain'
-        self.assertEqual(file.contentType, 'text/plain')
+        image._setData(zptlogo)
+        self.assertEqual(image.data, zptlogo)
+        self.assertEqual(image.contentType, 'image/gif')
+        self.assertEqual(image.getImageSize(), (16, 16))
 
-        file._setData('Foobar')
-        self.assertEqual(file.data, 'Foobar')
-
-        file.data = 'Blah'
-        file.contentType = 'text/html'
-        self.assertEqual(file.contentType, 'text/html')
-        self.assertEqual(file.data, 'Blah')
-
     def testInterface(self):
         self.failUnless(IImage.implementedBy(Image))
         self.failUnless(verifyClass(IImage, Image))



More information about the Zope3-Checkins mailing list