mirror of
https://github.com/python/cpython.git
synced 2026-01-04 06:22:20 +00:00
Two fixes to make this test pass on MacOS9:
- the test was sloppy about filenames: "0-REGTYPE-TEXT" was used where the archive held "/0-REGTYPE-TEXT". - tarfile extracts all files in binary mode, but the test expected to be able to read and compare text files in text mode. Use universal text mode.
This commit is contained in:
parent
834eff6a4c
commit
c7fcc2d772
1 changed files with 4 additions and 4 deletions
|
|
@ -74,7 +74,7 @@ def test_sparse(self):
|
|||
"""
|
||||
if self.sep != "|":
|
||||
f1 = self.tar.extractfile("S-SPARSE")
|
||||
f2 = self.tar.extractfile("S-SPARSE-WITH-NULLS")
|
||||
f2 = self.tar.extractfile("/S-SPARSE-WITH-NULLS")
|
||||
self.assert_(f1.read() == f2.read(),
|
||||
"_FileObject failed on sparse file member")
|
||||
|
||||
|
|
@ -82,9 +82,9 @@ def test_readlines(self):
|
|||
"""Test readlines() method of _FileObject.
|
||||
"""
|
||||
if self.sep != "|":
|
||||
filename = "0-REGTYPE-TEXT"
|
||||
filename = "/0-REGTYPE-TEXT"
|
||||
self.tar.extract(filename, dirname())
|
||||
lines1 = file(os.path.join(dirname(), filename), "r").readlines()
|
||||
lines1 = file(os.path.join(dirname(), filename), "rU").readlines()
|
||||
lines2 = self.tar.extractfile(filename).readlines()
|
||||
self.assert_(lines1 == lines2,
|
||||
"_FileObject.readline() does not work correctly")
|
||||
|
|
@ -93,7 +93,7 @@ def test_seek(self):
|
|||
"""Test seek() method of _FileObject, incl. random reading.
|
||||
"""
|
||||
if self.sep != "|":
|
||||
filename = "0-REGTYPE"
|
||||
filename = "/0-REGTYPE"
|
||||
self.tar.extract(filename, dirname())
|
||||
data = file(os.path.join(dirname(), filename), "rb").read()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue