diff options
| author | Raymond Hettinger <python@rcn.com> | 2003-08-08 12:20:03 +0000 |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2003-08-08 12:20:03 +0000 |
| commit | 5475f2394abea43c541d8660ed91af920634add5 (patch) | |
| tree | 714500f4e60cfc6950b1f9303bdd9da964e98795 /Lib/test/test_StringIO.py | |
| parent | 6e13bcc7b187aff61628120fa58e5cee2ae32f68 (diff) | |
| download | cpython-git-5475f2394abea43c541d8660ed91af920634add5.tar.gz | |
SF bug #770485: cStringIO does not set closed attr
Diffstat (limited to 'Lib/test/test_StringIO.py')
| -rw-r--r-- | Lib/test/test_StringIO.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_StringIO.py b/Lib/test/test_StringIO.py index 8c367e8c79..c318eaafc7 100644 --- a/Lib/test/test_StringIO.py +++ b/Lib/test/test_StringIO.py @@ -55,6 +55,16 @@ class TestGenericStringIO(unittest.TestCase): 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 |
