diff options
Diffstat (limited to 'Lib/test/test_mmap.py')
-rw-r--r-- | Lib/test/test_mmap.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index 4d23f16..3de84e8 100644 --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -282,6 +282,7 @@ class MmapTests(unittest.TestCase): self.assertEqual(m.find(b'one', 1), 8) self.assertEqual(m.find(b'one', 1, -1), 8) self.assertEqual(m.find(b'one', 1, -2), -1) + self.assertEqual(m.find(bytearray(b'one')), 0) def test_rfind(self): @@ -300,6 +301,7 @@ class MmapTests(unittest.TestCase): self.assertEqual(m.rfind(b'one', 0, -2), 0) self.assertEqual(m.rfind(b'one', 1, -1), 8) self.assertEqual(m.rfind(b'one', 1, -2), -1) + self.assertEqual(m.rfind(bytearray(b'one')), 8) def test_double_close(self): @@ -601,8 +603,10 @@ class MmapTests(unittest.TestCase): m.write(b"bar") self.assertEqual(m.tell(), 6) self.assertEqual(m[:], b"012bar6789") - m.seek(8) - self.assertRaises(ValueError, m.write, b"bar") + m.write(bytearray(b"baz")) + self.assertEqual(m.tell(), 9) + self.assertEqual(m[:], b"012barbaz9") + self.assertRaises(ValueError, m.write, b"ba") def test_non_ascii_byte(self): for b in (129, 200, 255): # > 128 |