summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2006-03-15 22:13:13 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2006-03-15 22:13:13 (GMT)
commit197e8321c659d8dd22851363bbcebd98092ed2c9 (patch)
tree77f10a6ecfb500e5940c3ea011f628bd7cf9b7cd /Lib
parent9998f78d6dc78e1e2652f07423e25353a32413a3 (diff)
downloadcpython-197e8321c659d8dd22851363bbcebd98092ed2c9.zip
cpython-197e8321c659d8dd22851363bbcebd98092ed2c9.tar.gz
cpython-197e8321c659d8dd22851363bbcebd98092ed2c9.tar.bz2
SF patch #1359365: cStringIO.StringIO.isatty() will raise a ValueError
now if close() has been called before (like file and StringIO.StringIO do)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_StringIO.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_StringIO.py b/Lib/test/test_StringIO.py
index a2e5444..cc3367f 100644
--- a/Lib/test/test_StringIO.py
+++ b/Lib/test/test_StringIO.py
@@ -75,6 +75,13 @@ class TestGenericStringIO(unittest.TestCase):
f.close()
self.assertEqual(f.closed, True)
+ def test_isatty(self):
+ f = self.MODULE.StringIO()
+ self.assertRaises(TypeError, f.isatty, None)
+ self.assertEqual(f.isatty(), False)
+ f.close()
+ self.assertRaises(ValueError, f.isatty)
+
def test_iterator(self):
eq = self.assertEqual
unless = self.failUnless