Back to index

python3.2  3.2.2
Public Member Functions
test.test_zipfile64.OtherTests Class Reference

List of all members.

Public Member Functions

def testMoreThan64kFiles
def tearDown

Detailed Description

Definition at line 97 of file test_zipfile64.py.


Member Function Documentation

Definition at line 116 of file test_zipfile64.py.

00116 
00117     def tearDown(self):
00118         support.unlink(TESTFN)
00119         support.unlink(TESTFN2)

Here is the caller graph for this function:

Definition at line 98 of file test_zipfile64.py.

00098 
00099     def testMoreThan64kFiles(self):
00100         # This test checks that more than 64k files can be added to an archive,
00101         # and that the resulting archive can be read properly by ZipFile
00102         zipf = zipfile.ZipFile(TESTFN, mode="w")
00103         zipf.debug = 100
00104         numfiles = (1 << 16) * 3//2
00105         for i in range(numfiles):
00106             zipf.writestr("foo%08d" % i, "%d" % (i**3 % 57))
00107         self.assertEqual(len(zipf.namelist()), numfiles)
00108         zipf.close()
00109 
00110         zipf2 = zipfile.ZipFile(TESTFN, mode="r")
00111         self.assertEqual(len(zipf2.namelist()), numfiles)
00112         for i in range(numfiles):
00113             content = zipf2.read("foo%08d" % i).decode('ascii')
00114             self.assertEqual(content, "%d" % (i**3 % 57))
00115         zipf.close()

Here is the call graph for this function:


The documentation for this class was generated from the following file: