summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-11-21 19:29:53 (GMT)
committerGuido van Rossum <guido@python.org>2007-11-21 19:29:53 (GMT)
commit254348e201647ad9d264de2cc0fde031e8214719 (patch)
treef5e6c42989ce114d4a9385404a6b23b2b1ff12af /Lib/test/test_io.py
parent905a904723abadc627be60bf944e2ca76329b06e (diff)
downloadcpython-254348e201647ad9d264de2cc0fde031e8214719.zip
cpython-254348e201647ad9d264de2cc0fde031e8214719.tar.gz
cpython-254348e201647ad9d264de2cc0fde031e8214719.tar.bz2
Rename buffer -> bytearray.
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 697f69e..7ca3fbb 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -88,7 +88,7 @@ class IOTest(unittest.TestCase):
self.assertEqual(f.tell(), 6)
self.assertEqual(f.seek(-1, 1), 5)
self.assertEqual(f.tell(), 5)
- self.assertEqual(f.write(buffer(b" world\n\n\n")), 9)
+ self.assertEqual(f.write(bytearray(b" world\n\n\n")), 9)
self.assertEqual(f.seek(0), 0)
self.assertEqual(f.write(b"h"), 1)
self.assertEqual(f.seek(-1, 2), 13)
@@ -100,7 +100,7 @@ class IOTest(unittest.TestCase):
def read_ops(self, f, buffered=False):
data = f.read(5)
self.assertEqual(data, b"hello")
- data = buffer(data)
+ data = bytearray(data)
self.assertEqual(f.readinto(data), 5)
self.assertEqual(data, b" worl")
self.assertEqual(f.readinto(data), 2)
@@ -109,11 +109,11 @@ class IOTest(unittest.TestCase):
self.assertEqual(f.seek(0), 0)
self.assertEqual(f.read(20), b"hello world\n")
self.assertEqual(f.read(1), b"")
- self.assertEqual(f.readinto(buffer(b"x")), 0)
+ self.assertEqual(f.readinto(bytearray(b"x")), 0)
self.assertEqual(f.seek(-6, 2), 6)
self.assertEqual(f.read(5), b"world")
self.assertEqual(f.read(0), b"")
- self.assertEqual(f.readinto(buffer()), 0)
+ self.assertEqual(f.readinto(bytearray()), 0)
self.assertEqual(f.seek(-6, 1), 5)
self.assertEqual(f.read(5), b" worl")
self.assertEqual(f.tell(), 10)