mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +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
|
@ -417,7 +417,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
|
||||
|
@ -512,27 +512,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")
|
||||
|
||||
|
@ -540,9 +540,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':
|
||||
|
@ -556,8 +556,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()
|
||||
|
||||
|
@ -566,8 +566,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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue