mirror of
https://github.com/python/cpython.git
synced 2025-10-02 21:25:24 +00:00
Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
This commit is contained in:
parent
b65b4937e2
commit
19f2aeba67
164 changed files with 2281 additions and 2279 deletions
|
@ -6,7 +6,7 @@ import sys
|
|||
import subprocess
|
||||
|
||||
|
||||
|
||||
|
||||
class LegacyBase64TestCase(unittest.TestCase):
|
||||
def test_encodebytes(self):
|
||||
eq = self.assertEqual
|
||||
|
@ -58,7 +58,7 @@ class LegacyBase64TestCase(unittest.TestCase):
|
|||
base64.decode(infp, outfp)
|
||||
self.assertEqual(outfp.getvalue(), b'www.python.org')
|
||||
|
||||
|
||||
|
||||
class BaseXYTestCase(unittest.TestCase):
|
||||
def test_b64encode(self):
|
||||
eq = self.assertEqual
|
||||
|
@ -209,7 +209,7 @@ class BaseXYTestCase(unittest.TestCase):
|
|||
self.assertTrue(issubclass(binascii.Error, ValueError))
|
||||
|
||||
|
||||
|
||||
|
||||
class TestMain(unittest.TestCase):
|
||||
def get_output(self, *args, **options):
|
||||
args = (sys.executable, '-m', 'base64') + args
|
||||
|
@ -228,20 +228,20 @@ class TestMain(unittest.TestCase):
|
|||
fp.write(b'a\xffb\n')
|
||||
|
||||
output = self.get_output('-e', support.TESTFN)
|
||||
self.assertEquals(output.rstrip(), b'Yf9iCg==')
|
||||
self.assertEqual(output.rstrip(), b'Yf9iCg==')
|
||||
|
||||
with open(support.TESTFN, 'rb') as fp:
|
||||
output = self.get_output('-e', stdin=fp)
|
||||
self.assertEquals(output.rstrip(), b'Yf9iCg==')
|
||||
self.assertEqual(output.rstrip(), b'Yf9iCg==')
|
||||
|
||||
def test_decode(self):
|
||||
with open(support.TESTFN, 'wb') as fp:
|
||||
fp.write(b'Yf9iCg==')
|
||||
output = self.get_output('-d', support.TESTFN)
|
||||
self.assertEquals(output.rstrip(), b'a\xffb')
|
||||
self.assertEqual(output.rstrip(), b'a\xffb')
|
||||
|
||||
|
||||
|
||||
|
||||
def test_main():
|
||||
support.run_unittest(__name__)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue