diff options
author | Guido van Rossum <guido@python.org> | 2007-07-11 12:20:59 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-11 12:20:59 (GMT) |
commit | e61fd5b5ed9d677da2f3349078d7f66f707199de (patch) | |
tree | e28a7630ed3c285eabc7631f4276a2b06e74682b /Lib/test/test_tarfile.py | |
parent | c9b9de17976a4832f505309b1096f9a7582c7be9 (diff) | |
download | cpython-e61fd5b5ed9d677da2f3349078d7f66f707199de.zip cpython-e61fd5b5ed9d677da2f3349078d7f66f707199de.tar.gz cpython-e61fd5b5ed9d677da2f3349078d7f66f707199de.tar.bz2 |
Patch by Christian Heimes to change self.assert_(x == y) into
self.assertEqual(x, y). (Christian used self.failUnlessEqual(),
but the double negative makes it hard to grok, so I changed it.)
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r-- | Lib/test/test_tarfile.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 1bfe9dcd..eaaccd3 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -98,27 +98,27 @@ class UstarReadTest(ReadTest): text = fobj.read() fobj.seek(0) - self.assert_(0 == fobj.tell(), + self.assertEqual(0, fobj.tell(), "seek() to file's start failed") fobj.seek(2048, 0) - self.assert_(2048 == fobj.tell(), + self.assertEqual(2048, fobj.tell(), "seek() to absolute position failed") fobj.seek(-1024, 1) - self.assert_(1024 == fobj.tell(), + self.assertEqual(1024, fobj.tell(), "seek() to negative relative position failed") fobj.seek(1024, 1) - self.assert_(2048 == fobj.tell(), + self.assertEqual(2048, fobj.tell(), "seek() to positive relative position failed") s = fobj.read(10) self.assert_(s == data[2048:2058], "read() after seek failed") fobj.seek(0, 2) - self.assert_(tarinfo.size == fobj.tell(), + self.assertEqual(tarinfo.size, fobj.tell(), "seek() to file's end failed") self.assert_(fobj.read() == "", "read() at file's end did not return empty string") fobj.seek(-tarinfo.size, 2) - self.assert_(0 == fobj.tell(), + self.assertEqual(0, fobj.tell(), "relative seek() to file's start failed") fobj.seek(512) s1 = fobj.readlines() @@ -127,14 +127,14 @@ class UstarReadTest(ReadTest): self.assert_(s1 == s2, "readlines() after seek failed") fobj.seek(0) - self.assert_(len(fobj.readline()) == fobj.tell(), + self.assertEqual(len(fobj.readline()), fobj.tell(), "tell() after readline() failed") fobj.seek(512) self.assert_(len(fobj.readline()) + 512 == fobj.tell(), "tell() after seek() and readline() failed") fobj.seek(0) line = fobj.readline() - self.assert_(fobj.read() == data[len(line):], + self.assertEqual(fobj.read(), data[len(line):], "read() after readline() failed") fobj.close() @@ -235,7 +235,7 @@ class StreamReadTest(ReadTest): if v1 is None: continue self.assert_(v2 is not None, "stream.extractfile() failed") - self.assert_(v1.read() == v2.read(), "stream extraction failed") + self.assertEqual(v1.read(), v2.read(), "stream extraction failed") tar1.close() @@ -417,7 +417,7 @@ class GNUReadTest(LongnameTest): fobj1 = self.tar.extractfile(tarinfo1) tarinfo2 = self.tar.getmember("gnu/sparse") fobj2 = self.tar.extractfile(tarinfo2) - self.assert_(fobj1.read() == fobj2.read(), + self.assertEqual(fobj1.read(), fobj2.read(), "sparse file extraction failed") |