summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_io.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 1be1b71..03cdfef 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -70,10 +70,13 @@ class IOTest(unittest.TestCase):
def read_ops(self, f):
data = f.read(5)
self.assertEqual(data, b"hello")
- f.readinto(data)
+ n = f.readinto(data)
+ self.assertEqual(n, 5)
self.assertEqual(data, b" worl")
- f.readinto(data)
- self.assertEqual(data, b"d\n")
+ n = f.readinto(data)
+ self.assertEqual(n, 2)
+ self.assertEqual(len(data), 5)
+ self.assertEqual(data[:2], b"d\n")
f.seek(0)
self.assertEqual(f.read(20), b"hello world\n")
f.seek(-6, 2)