summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bytes.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-11-21 01:30:29 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-11-21 01:30:29 (GMT)
commit19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee (patch)
tree596b5a2c45b058ea3e0cdc49cb7539a21410b98d /Lib/test/test_bytes.py
parentb65b4937e20be4a2d3311326909c77bbf2e1c4cd (diff)
downloadcpython-19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee.zip
cpython-19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee.tar.gz
cpython-19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee.tar.bz2
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. ........
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 28ae5ca..8b964ca 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -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