summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mmap.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_mmap.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_mmap.py')
-rw-r--r--Lib/test/test_mmap.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index f78fed9..abfde01 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -413,7 +413,7 @@ class MmapTests(unittest.TestCase):
data = bytes(reversed(data))
L[start:stop:step] = data
m[start:stop:step] = data
- self.assertEquals(m[:], bytes(L))
+ self.assertEqual(m[:], bytes(L))
def make_mmap_file (self, f, halfsize):
# Write 2 pages worth of data to the file
@@ -510,27 +510,27 @@ class MmapTests(unittest.TestCase):
f.close()
# Test write_byte()
for i in range(len(data)):
- self.assertEquals(m.tell(), i)
+ self.assertEqual(m.tell(), i)
m.write_byte(data[i])
- self.assertEquals(m.tell(), i+1)
+ self.assertEqual(m.tell(), i+1)
self.assertRaises(ValueError, m.write_byte, b"x"[0])
- self.assertEquals(m[:], data)
+ self.assertEqual(m[:], data)
# Test read_byte()
m.seek(0)
for i in range(len(data)):
- self.assertEquals(m.tell(), i)
- self.assertEquals(m.read_byte(), data[i])
- self.assertEquals(m.tell(), i+1)
+ self.assertEqual(m.tell(), i)
+ self.assertEqual(m.read_byte(), data[i])
+ self.assertEqual(m.tell(), i+1)
self.assertRaises(ValueError, m.read_byte)
# Test read()
m.seek(3)
- self.assertEquals(m.read(3), b"345")
- self.assertEquals(m.tell(), 6)
+ self.assertEqual(m.read(3), b"345")
+ self.assertEqual(m.tell(), 6)
# Test write()
m.seek(3)
m.write(b"bar")
- self.assertEquals(m.tell(), 6)
- self.assertEquals(m[:], b"012bar6789")
+ self.assertEqual(m.tell(), 6)
+ self.assertEqual(m[:], b"012bar6789")
m.seek(8)
self.assertRaises(ValueError, m.write, b"bar")
@@ -538,9 +538,9 @@ class MmapTests(unittest.TestCase):
for b in (129, 200, 255): # > 128
m = mmap.mmap(-1, 1)
m.write_byte(b)
- self.assertEquals(m[0], b)
+ self.assertEqual(m[0], b)
m.seek(0)
- self.assertEquals(m.read_byte(), b)
+ self.assertEqual(m.read_byte(), b)
m.close()
if os.name == 'nt':
@@ -554,8 +554,8 @@ class MmapTests(unittest.TestCase):
m1[:] = data1
m2 = mmap.mmap(-1, len(data2), tagname="foo")
m2[:] = data2
- self.assertEquals(m1[:], data2)
- self.assertEquals(m2[:], data2)
+ self.assertEqual(m1[:], data2)
+ self.assertEqual(m2[:], data2)
m2.close()
m1.close()
@@ -564,8 +564,8 @@ class MmapTests(unittest.TestCase):
m1[:] = data1
m2 = mmap.mmap(-1, len(data2), tagname="boo")
m2[:] = data2
- self.assertEquals(m1[:], data1)
- self.assertEquals(m2[:], data2)
+ self.assertEqual(m1[:], data1)
+ self.assertEqual(m2[:], data2)
m2.close()
m1.close()