summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bz2.py
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2003-04-29 14:53:08 (GMT)
committerGustavo Niemeyer <gustavo@niemeyer.net>2003-04-29 14:53:08 (GMT)
commit572f5233f0263ab75782bbce4bd67259d73e32ac (patch)
treee2a6945a7feddd4b34febd527a13f024827a94dd /Lib/test/test_bz2.py
parenta649e9cb7af5be27ac66b7e128417b8c7e093264 (diff)
downloadcpython-572f5233f0263ab75782bbce4bd67259d73e32ac.zip
cpython-572f5233f0263ab75782bbce4bd67259d73e32ac.tar.gz
cpython-572f5233f0263ab75782bbce4bd67259d73e32ac.tar.bz2
Applying patch #728656, by logistix, fixing opening of nonexistent
bz2 files. Also, included a testcase for this problem.
Diffstat (limited to 'Lib/test/test_bz2.py')
-rw-r--r--Lib/test/test_bz2.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index 9134aae..64ce6ab 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -219,11 +219,16 @@ class BZ2FileTest(BaseTest):
bz2f.close()
def testOpenDel(self):
+ # "Test opening and deleting a file many times"
self.createTempFile()
for i in xrange(10000):
o = BZ2File(self.filename)
del o
+ def testOpenNonexistent(self):
+ # "Test opening a nonexistent file"
+ self.assertRaises(IOError, BZ2File, "/non/existent")
+
class BZ2CompressorTest(BaseTest):
def testCompress(self):
# "Test BZ2Compressor.compress()/flush()"