summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bytes.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-11-20 19:04:17 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-11-20 19:04:17 (GMT)
commitb3aedd48621ed9d33b5f42f946b256bce4a50673 (patch)
tree2297c8ebce1b09621e1d98096c1603896d9a0f0c /Lib/test/test_bytes.py
parentb8bc439b2093add9b313bcca2cc507a2d0e87764 (diff)
downloadcpython-b3aedd48621ed9d33b5f42f946b256bce4a50673.zip
cpython-b3aedd48621ed9d33b5f42f946b256bce4a50673.tar.gz
cpython-b3aedd48621ed9d33b5f42f946b256bce4a50673.tar.bz2
#9424: Replace deprecated assert* methods in the Python test suite.
Diffstat (limited to 'Lib/test/test_bytes.py')
-rw-r--r--Lib/test/test_bytes.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 0695084..24ee487 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -266,11 +266,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')
@@ -626,11 +626,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
@@ -809,25 +809,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)
class AssortedBytesTest(unittest.TestCase):