diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-11-09 06:49:43 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-11-09 06:49:43 (GMT) |
commit | 63c1081ae37efb827dd962abe552b14d92832361 (patch) | |
tree | 9cce9189865edd874672b281b91591bb581c13c1 | |
parent | 9de06bd60595de2719b313b697b8bf7f6715db9a (diff) | |
download | cpython-63c1081ae37efb827dd962abe552b14d92832361.zip cpython-63c1081ae37efb827dd962abe552b14d92832361.tar.gz cpython-63c1081ae37efb827dd962abe552b14d92832361.tar.bz2 |
OK -- all tests pass on Windows now. The rest were due to 3 more
binary-vs-text-mode screwups.
-rw-r--r-- | Lib/test/test_bz2.py | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py index 973ae42..e6042a2 100644 --- a/Lib/test/test_bz2.py +++ b/Lib/test/test_bz2.py @@ -33,22 +33,9 @@ class BaseTest(unittest.TestCase): else: # popen2.Popen3 doesn't exist on Windows, and even if it did, bunzip2 # isn't available to run. - - # XXX This alternative doesn't work in all tests. It raises - # XXX ValueError: couldn't find end of stream - # XXX in - # XXX testWrite - # XXX testWriteChunks10 - # XXX testWriteLines - # XXX from BZ2FileTest . - # XXX I don't know why. - def decompress(self, data): return bz2.decompress(data) - # XXX See XXX comment above. - skip_mystery_test = not has_cmdline_bunzip2 - class BZ2FileTest(BaseTest): "Test MCRYPT type miscelaneous methods." @@ -145,20 +132,18 @@ class BZ2FileTest(BaseTest): bz2f.close() def testWrite(self): - if self.skip_mystery_test: - return + #if self.skip_mystery_test: + # return # "Test BZ2File.write()" bz2f = BZ2File(self.filename, "w") bz2f.write(self.TEXT) bz2f.close() - f = open(self.filename) + f = open(self.filename, 'rb') self.assertEqual(self.decompress(f.read()), self.TEXT) f.close() def testWriteChunks10(self): # "Test BZ2File.write() with chunks of 10 bytes" - if self.skip_mystery_test: - return bz2f = BZ2File(self.filename, "w") n = 0 while 1: @@ -168,19 +153,17 @@ class BZ2FileTest(BaseTest): bz2f.write(str) n += 1 bz2f.close() - f = open(self.filename) + f = open(self.filename, 'rb') self.assertEqual(self.decompress(f.read()), self.TEXT) f.close() def testWriteLines(self): # "Test BZ2File.writelines()" - if self.skip_mystery_test: - return bz2f = BZ2File(self.filename, "w") sio = StringIO(self.TEXT) bz2f.writelines(sio.readlines()) bz2f.close() - f = open(self.filename) + f = open(self.filename, 'rb') self.assertEqual(self.decompress(f.read()), self.TEXT) f.close() |