[Python-checkins] python/dist/src/Lib/test test_bz2.py, 1.16.2.1, 1.16.2.2

birkenfeld@users.sourceforge.net birkenfeld at users.sourceforge.net
Thu Aug 25 15:11:08 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5002/Lib/test

Modified Files:
      Tag: release24-maint
	test_bz2.py 
Log Message:
Backport fixes for bugs #1191043 and #1215928.



Index: test_bz2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bz2.py,v
retrieving revision 1.16.2.1
retrieving revision 1.16.2.2
diff -u -d -r1.16.2.1 -r1.16.2.2
--- test_bz2.py	3 Jun 2005 19:45:53 -0000	1.16.2.1
+++ test_bz2.py	25 Aug 2005 13:10:58 -0000	1.16.2.2
@@ -37,7 +37,7 @@
             return bz2.decompress(data)
 
 class BZ2FileTest(BaseTest):
-    "Test MCRYPT type miscelaneous methods."
+    "Test BZ2File type miscellaneous methods."
 
     def setUp(self):
         self.filename = TESTFN
@@ -245,6 +245,22 @@
         self.assertEqual(f.tell(), len(self.DATA))
         f.close()
 
+    def testBug1191043(self):
+        # readlines() for files containing no newline
+        data = 'BZh91AY&SY\xd9b\x89]\x00\x00\x00\x03\x80\x04\x00\x02\x00\x0c\x00 \x00!\x9ah3M\x13<]\xc9\x14\xe1BCe\x8a%t'
+        f = open(self.filename, "wb")
+        f.write(data)
+        f.close()
+        bz2f = BZ2File(self.filename)
+        lines = bz2f.readlines()
+        bz2f.close()
+        self.assertEqual(lines, ['Test'])
+        bz2f = BZ2File(self.filename)
+        xlines = bz2f.xreadlines()
+        bz2f.close()
+        self.assertEqual(lines, ['Test'])
+
+
 class BZ2CompressorTest(BaseTest):
     def testCompress(self):
         # "Test BZ2Compressor.compress()/flush()"



More information about the Python-checkins mailing list