mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Merged revisions 77781-77782 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r77781 | benjamin.peterson | 2010-01-26 19:47:14 -0600 (Tue, 26 Jan 2010) | 1 line don't accept bytes in FileIO.write #7785 ........ r77782 | benjamin.peterson | 2010-01-26 19:51:29 -0600 (Tue, 26 Jan 2010) | 1 line add issue number ........
This commit is contained in:
parent
0a8f347fbc
commit
371c307e56
3 changed files with 7 additions and 2 deletions
|
@ -78,6 +78,9 @@ class AutoFileTests(unittest.TestCase):
|
|||
self.assertEqual(self.f.readline(None), b"hi\n")
|
||||
self.assertEqual(self.f.readlines(None), [b"bye\n", b"abc"])
|
||||
|
||||
def test_reject(self):
|
||||
self.assertRaises(TypeError, self.f.write, "Hello!")
|
||||
|
||||
def testRepr(self):
|
||||
self.assertEquals(repr(self.f), "<_io.FileIO name=%r mode=%r>"
|
||||
% (self.f.name, self.f.mode))
|
||||
|
@ -170,7 +173,7 @@ class AutoFileTests(unittest.TestCase):
|
|||
|
||||
@ClosedFDRaises
|
||||
def testErrnoOnClosedWrite(self, f):
|
||||
f.write('a')
|
||||
f.write(b'a')
|
||||
|
||||
@ClosedFDRaises
|
||||
def testErrnoOnClosedSeek(self, f):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue