diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-30 22:57:08 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-30 22:57:08 (GMT) |
commit | 5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e (patch) | |
tree | 41f38aca16748628d53906337f06fdf087f52314 /Lib/test/test_zlib.py | |
parent | be96cf608fa656d7e53144cf85082ed5661e8c13 (diff) | |
download | cpython-5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e.zip cpython-5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e.tar.gz cpython-5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e.tar.bz2 |
convert usage of fail* to assert*
Diffstat (limited to 'Lib/test/test_zlib.py')
-rw-r--r-- | Lib/test/test_zlib.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index cbf844f..f1f9d38 100644 --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -10,7 +10,7 @@ class ChecksumTestCase(unittest.TestCase): # checksum test cases def test_crc32start(self): self.assertEqual(zlib.crc32(""), zlib.crc32("", 0)) - self.assert_(zlib.crc32("abc", 0xffffffff)) + self.assertTrue(zlib.crc32("abc", 0xffffffff)) def test_crc32empty(self): self.assertEqual(zlib.crc32("", 0), 0) @@ -19,7 +19,7 @@ class ChecksumTestCase(unittest.TestCase): def test_adler32start(self): self.assertEqual(zlib.adler32(""), zlib.adler32("", 1)) - self.assert_(zlib.adler32("abc", 0xffffffff)) + self.assertTrue(zlib.adler32("abc", 0xffffffff)) def test_adler32empty(self): self.assertEqual(zlib.adler32("", 0), 0) @@ -208,7 +208,7 @@ class CompressObjectTestCase(unittest.TestCase): while cb: #max_length = 1 + len(cb)//10 chunk = dco.decompress(cb, dcx) - self.failIf(len(chunk) > dcx, + self.assertFalse(len(chunk) > dcx, 'chunk too big (%d>%d)' % (len(chunk), dcx)) bufs.append(chunk) cb = dco.unconsumed_tail @@ -233,7 +233,7 @@ class CompressObjectTestCase(unittest.TestCase): while cb: max_length = 1 + len(cb)//10 chunk = dco.decompress(cb, max_length) - self.failIf(len(chunk) > max_length, + self.assertFalse(len(chunk) > max_length, 'chunk too big (%d>%d)' % (len(chunk),max_length)) bufs.append(chunk) cb = dco.unconsumed_tail @@ -242,7 +242,7 @@ class CompressObjectTestCase(unittest.TestCase): else: while chunk: chunk = dco.decompress('', max_length) - self.failIf(len(chunk) > max_length, + self.assertFalse(len(chunk) > max_length, 'chunk too big (%d>%d)' % (len(chunk),max_length)) bufs.append(chunk) self.assertEqual(data, ''.join(bufs), 'Wrong data retrieved') @@ -316,7 +316,7 @@ class CompressObjectTestCase(unittest.TestCase): # caused a core dump.) co = zlib.compressobj(zlib.Z_BEST_COMPRESSION) - self.failUnless(co.flush()) # Returns a zlib header + self.assertTrue(co.flush()) # Returns a zlib header dco = zlib.decompressobj() self.assertEqual(dco.flush(), "") # Returns nothing |