test_misc.py 文件源码

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

项目:obsoleted-vpduserv 作者: InfraSIM 项目源码 文件源码
def test_bad_arguments (self):
        '''This tests that we get a graceful error when passing bad arguments.'''
        with self.assertRaises(pexpect.ExceptionPexpect):
            pexpect.spawn(1)

        with self.assertRaises(TypeError):
            # should use pexpect.spawn('ls', ['-la'])
            pexpect.spawn('ls', '-la')

        with self.assertRaises(ValueError):
            p = pexpect.spawn('cat', timeout=5)
            p.close()
            p.read_nonblocking(size=1, timeout=3)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号