[Zope-Checkins] CVS: Packages/OFS/tests -
testFileAndImage.py:1.1.2.3
Florent Guillaume
fg at nuxeo.com
Fri Nov 5 10:00:54 EST 2004
Update of /cvs-repository/Packages/OFS/tests
In directory cvs.zope.org:/tmp/cvs-serv7075/lib/python/OFS/tests
Modified Files:
Tag: Zope-2_7-branch
testFileAndImage.py
Log Message:
Collector #934: Image and File objects are now always internally
split into small Pdata chunks even when initialized from a string.
=== Packages/OFS/tests/testFileAndImage.py 1.1.2.2 => 1.1.2.3 ===
--- Packages/OFS/tests/testFileAndImage.py:1.1.2.2 Sat Oct 30 04:31:23 2004
+++ Packages/OFS/tests/testFileAndImage.py Fri Nov 5 10:00:54 2004
@@ -131,6 +131,16 @@
self.assertEqual(len(s), len(str(data)))
self.assertEqual(len(s), size)
+ def testBigPdata(self):
+ # Test that a big enough string is split into several Pdata
+ # From a file
+ s = "a" * (1 << 16) * 3
+ data, size = self.file._read_data(StringIO(s))
+ self.failIfEqual(data.next, None)
+ # From a string
+ data, size = self.file._read_data(s)
+ self.failIfEqual(data.next, None)
+
def testManageEditWithFileData(self):
self.file.manage_edit('foobar', 'text/plain', filedata='ASD')
self.assertEqual(self.file.title, 'foobar')
More information about the Zope-Checkins
mailing list