Back to index

python3.2  3.2.2
Public Member Functions
test.test_zipfile.TestsWithMultipleOpens Class Reference

List of all members.

Public Member Functions

def setUp
def test_same_file
def test_different_file
def test_interleaved
def tearDown

Detailed Description

Definition at line 1238 of file test_zipfile.py.


Member Function Documentation

Definition at line 1239 of file test_zipfile.py.

01239 
01240     def setUp(self):
01241         # Create the ZIP archive
01242         with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_DEFLATED) as zipfp:
01243             zipfp.writestr('ones', '1'*FIXEDTEST_SIZE)
01244             zipfp.writestr('twos', '2'*FIXEDTEST_SIZE)

Here is the caller graph for this function:

Definition at line 1280 of file test_zipfile.py.

01280 
01281     def tearDown(self):
01282         unlink(TESTFN2)
01283 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1256 of file test_zipfile.py.

01256 
01257     def test_different_file(self):
01258         # Verify that (when the ZipFile is in control of creating file objects)
01259         # multiple open() calls can be made without interfering with each other.
01260         with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
01261             with zipf.open('ones') as zopen1, zipf.open('twos') as zopen2:
01262                 data1 = zopen1.read(500)
01263                 data2 = zopen2.read(500)
01264                 data1 += zopen1.read(500)
01265                 data2 += zopen2.read(500)
01266             self.assertEqual(data1, b'1'*FIXEDTEST_SIZE)
01267             self.assertEqual(data2, b'2'*FIXEDTEST_SIZE)

Here is the call graph for this function:

Definition at line 1268 of file test_zipfile.py.

01268 
01269     def test_interleaved(self):
01270         # Verify that (when the ZipFile is in control of creating file objects)
01271         # multiple open() calls can be made without interfering with each other.
01272         with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
01273             with zipf.open('ones') as zopen1, zipf.open('twos') as zopen2:
01274                 data1 = zopen1.read(500)
01275                 data2 = zopen2.read(500)
01276                 data1 += zopen1.read(500)
01277                 data2 += zopen2.read(500)
01278             self.assertEqual(data1, b'1'*FIXEDTEST_SIZE)
01279             self.assertEqual(data2, b'2'*FIXEDTEST_SIZE)

Here is the call graph for this function:

Definition at line 1245 of file test_zipfile.py.

01245 
01246     def test_same_file(self):
01247         # Verify that (when the ZipFile is in control of creating file objects)
01248         # multiple open() calls can be made without interfering with each other.
01249         with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
01250             with zipf.open('ones') as zopen1, zipf.open('ones') as zopen2:
01251                 data1 = zopen1.read(500)
01252                 data2 = zopen2.read(500)
01253                 data1 += zopen1.read(500)
01254                 data2 += zopen2.read(500)
01255             self.assertEqual(data1, data2)

Here is the call graph for this function:


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