summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fileio.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-04-16 08:19:43 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-04-16 08:19:43 (GMT)
commitf24131ff3125e59ca779d0e2fcec4967d50f950c (patch)
treec870dd7568c6bdf0b8340e282ced5205c71ee618 /Lib/test/test_fileio.py
parent7f90cba7f3f2ebd7eb5e614917014760f61c6ec8 (diff)
downloadcpython-f24131ff3125e59ca779d0e2fcec4967d50f950c.zip
cpython-f24131ff3125e59ca779d0e2fcec4967d50f950c.tar.gz
cpython-f24131ff3125e59ca779d0e2fcec4967d50f950c.tar.bz2
Issue #20175: Converted the _io module to Argument Clinic.
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