mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +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
|
@ -246,11 +246,11 @@ class BaseBytesTest(unittest.TestCase):
|
|||
def test_fromhex(self):
|
||||
self.assertRaises(TypeError, self.type2test.fromhex)
|
||||
self.assertRaises(TypeError, self.type2test.fromhex, 1)
|
||||
self.assertEquals(self.type2test.fromhex(''), self.type2test())
|
||||
self.assertEqual(self.type2test.fromhex(''), self.type2test())
|
||||
b = bytearray([0x1a, 0x2b, 0x30])
|
||||
self.assertEquals(self.type2test.fromhex('1a2B30'), b)
|
||||
self.assertEquals(self.type2test.fromhex(' 1A 2B 30 '), b)
|
||||
self.assertEquals(self.type2test.fromhex('0000'), b'\0\0')
|
||||
self.assertEqual(self.type2test.fromhex('1a2B30'), b)
|
||||
self.assertEqual(self.type2test.fromhex(' 1A 2B 30 '), b)
|
||||
self.assertEqual(self.type2test.fromhex('0000'), b'\0\0')
|
||||
self.assertRaises(TypeError, self.type2test.fromhex, b'1B')
|
||||
self.assertRaises(ValueError, self.type2test.fromhex, 'a')
|
||||
self.assertRaises(ValueError, self.type2test.fromhex, 'rt')
|
||||
|
@ -609,11 +609,11 @@ class ByteArrayTest(BaseBytesTest):
|
|||
data.reverse()
|
||||
L[start:stop:step] = data
|
||||
b[start:stop:step] = data
|
||||
self.assertEquals(b, bytearray(L))
|
||||
self.assertEqual(b, bytearray(L))
|
||||
|
||||
del L[start:stop:step]
|
||||
del b[start:stop:step]
|
||||
self.assertEquals(b, bytearray(L))
|
||||
self.assertEqual(b, bytearray(L))
|
||||
|
||||
def test_setslice_trap(self):
|
||||
# This test verifies that we correctly handle assigning self
|
||||
|
@ -792,25 +792,25 @@ class ByteArrayTest(BaseBytesTest):
|
|||
resize(10)
|
||||
orig = b[:]
|
||||
self.assertRaises(BufferError, resize, 11)
|
||||
self.assertEquals(b, orig)
|
||||
self.assertEqual(b, orig)
|
||||
self.assertRaises(BufferError, resize, 9)
|
||||
self.assertEquals(b, orig)
|
||||
self.assertEqual(b, orig)
|
||||
self.assertRaises(BufferError, resize, 0)
|
||||
self.assertEquals(b, orig)
|
||||
self.assertEqual(b, orig)
|
||||
# Other operations implying resize
|
||||
self.assertRaises(BufferError, b.pop, 0)
|
||||
self.assertEquals(b, orig)
|
||||
self.assertEqual(b, orig)
|
||||
self.assertRaises(BufferError, b.remove, b[1])
|
||||
self.assertEquals(b, orig)
|
||||
self.assertEqual(b, orig)
|
||||
def delitem():
|
||||
del b[1]
|
||||
self.assertRaises(BufferError, delitem)
|
||||
self.assertEquals(b, orig)
|
||||
self.assertEqual(b, orig)
|
||||
# deleting a non-contiguous slice
|
||||
def delslice():
|
||||
b[1:-1:2] = b""
|
||||
self.assertRaises(BufferError, delslice)
|
||||
self.assertEquals(b, orig)
|
||||
self.assertEqual(b, orig)
|
||||
|
||||
def test_empty_bytearray(self):
|
||||
# Issue #7561: operations on empty bytearrays could crash in many
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue