SF bug #770485: cStringIO does not set closed attr
diff --git a/Lib/test/test_StringIO.py b/Lib/test/test_StringIO.py
index 8c367e8..c318eaa 100644
--- a/Lib/test/test_StringIO.py
+++ b/Lib/test/test_StringIO.py
@@ -55,6 +55,16 @@
f.close()
self.assertRaises(ValueError, f.write, 'frobnitz')
+ def test_closed_flag(self):
+ f = self.MODULE.StringIO()
+ self.assertEqual(f.closed, False)
+ f.close()
+ self.assertEqual(f.closed, True)
+ f = self.MODULE.StringIO("abc")
+ self.assertEqual(f.closed, False)
+ f.close()
+ self.assertEqual(f.closed, True)
+
def test_iterator(self):
eq = self.assertEqual
unless = self.failUnless