test_fileio.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:oil 作者: oilshell 项目源码 文件源码
def testAblesOnTTY(self):
        try:
            f = _FileIO("/dev/tty", "a")
        except EnvironmentError:
            # When run in a cron job there just aren't any
            # ttys, so skip the test.  This also handles other
            # OS'es that don't support /dev/tty.
            self.skipTest('need /dev/tty')
        else:
            self.assertEqual(f.readable(), False)
            self.assertEqual(f.writable(), True)
            if sys.platform != "darwin" and \
               'bsd' not in sys.platform and \
               not sys.platform.startswith(('sunos', 'aix')):
                # Somehow /dev/tty appears seekable on some BSDs
                self.assertEqual(f.seekable(), False)
            self.assertEqual(f.isatty(), True)
            f.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号