summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fileio.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_fileio.py')
-rw-r--r--Lib/test/test_fileio.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
index 35b30a6..0f8310c 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -190,9 +190,9 @@ class AutoFileTests:
self.assertTrue(f.closed)
def testMethods(self):
- methods = ['fileno', 'isatty', 'read',
- 'tell', 'truncate', 'seekable',
- 'readable', 'writable']
+ methods = ['fileno', 'isatty', 'seekable', 'readable', 'writable',
+ 'read', 'readall', 'readline', 'readlines',
+ 'tell', 'truncate', 'flush']
self.f.close()
self.assertTrue(self.f.closed)
@@ -201,9 +201,15 @@ class AutoFileTests:
method = getattr(self.f, methodname)
# should raise on closed file
self.assertRaises(ValueError, method)
- self.assertRaises(ValueError, self.f.readinto, bytearray())
- self.assertRaises(ValueError, self.f.seek, 0, os.SEEK_CUR)
+
+ self.assertRaises(TypeError, self.f.readinto)
+ self.assertRaises(ValueError, self.f.readinto, bytearray(1))
+ self.assertRaises(TypeError, self.f.seek)
+ self.assertRaises(ValueError, self.f.seek, 0)
+ self.assertRaises(TypeError, self.f.write)
self.assertRaises(ValueError, self.f.write, b'')
+ self.assertRaises(TypeError, self.f.writelines)
+ self.assertRaises(ValueError, self.f.writelines, b'')
def testOpendir(self):
# Issue 3703: opening a directory should fill the errno