Commit 682faf8f authored by Guido van Rossum's avatar Guido van Rossum

Fix most XXX remarks.

parent 31c3a574
...@@ -67,9 +67,9 @@ class AutoFileTests(unittest.TestCase): ...@@ -67,9 +67,9 @@ class AutoFileTests(unittest.TestCase):
self.assertEquals(array('b', [1, 2]), a[:n]) self.assertEquals(array('b', [1, 2]), a[:n])
def testRepr(self): def testRepr(self):
# verify repr works self.assertEquals(repr(self.f),
return # XXX doesn't work yet "_fileio._FileIO(%d, %s)" % (self.f.fileno(),
self.assert_(repr(self.f).startswith("<open file '" + TESTFN)) repr(self.f.mode)))
def testErrors(self): def testErrors(self):
f = self.f f = self.f
...@@ -123,13 +123,16 @@ class OtherFileTests(unittest.TestCase): ...@@ -123,13 +123,16 @@ class OtherFileTests(unittest.TestCase):
self.assertEquals(f.seekable(), True) self.assertEquals(f.seekable(), True)
self.assertEquals(f.isatty(), False) self.assertEquals(f.isatty(), False)
f.close() f.close()
f = _fileio._FileIO("/dev/tty", "a") # XXX, won't work on e.g., Windows if not sys.platform.startswith("win"):
self.assertEquals(f.readable(), False) f = _fileio._FileIO("/dev/tty", "a")
self.assertEquals(f.writable(), True) self.assertEquals(f.readable(), False)
##self.assertEquals(f.seekable(), False) # XXX True on OSX!? self.assertEquals(f.writable(), True)
self.assertEquals(f.isatty(), True) if sys.platform != "darwin":
f.close() # Somehow /dev/tty appears seekable on OSX
self.assertEquals(f.seekable(), False)
self.assertEquals(f.isatty(), True)
f.close()
finally: finally:
os.unlink(TESTFN) os.unlink(TESTFN)
...@@ -144,23 +147,9 @@ class OtherFileTests(unittest.TestCase): ...@@ -144,23 +147,9 @@ class OtherFileTests(unittest.TestCase):
f.close() f.close()
self.fail('%r is an invalid file mode' % mode) self.fail('%r is an invalid file mode' % mode)
def testStdin(self):
## This causes the interpreter to exit on OSF1 v5.1.
#if sys.platform != 'osf1V5':
# self.assertRaises(IOError, sys.stdin.seek, -1)
#else:
# print((
# ' Skipping sys.stdin.seek(-1), it may crash the interpreter.'
# ' Test manually.'), file=sys.__stdout__)
#self.assertRaises(IOError, sys.stdin.truncate)
# XXX Comment this out since sys.stdin is currently an old style file
pass
def testUnicodeOpen(self): def testUnicodeOpen(self):
# verify repr works for unicode too # verify repr works for unicode too
f = _fileio._FileIO(unicode(TESTFN), "w") f = _fileio._FileIO(unicode(TESTFN), "w")
# XXX doesn't work yet:
##self.assert_(repr(f).startswith("<open file u'" + TESTFN))
f.close() f.close()
os.unlink(TESTFN) os.unlink(TESTFN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment