Backport of r67908:
Added test case to ensure attempts to read from a file opened for writing fail.
This commit is contained in:
parent
b90b144c47
commit
edf14317e3
|
@ -116,6 +116,8 @@ class AutoFileTests(unittest.TestCase):
|
|||
except:
|
||||
self.assertEquals(self.f.__exit__(*sys.exc_info()), None)
|
||||
|
||||
def testReadWhenWriting(self):
|
||||
self.assertRaises(IOError, self.f.read)
|
||||
|
||||
class OtherFileTests(unittest.TestCase):
|
||||
|
||||
|
|
Loading…
Reference in New Issue