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)
评论列表
文章目录