def test_fd_isatty (self):
fd = os.open ('TESTDATA.txt', os.O_RDONLY)
s = pexpect.spawn (fd)
assert not s.isatty()
os.close(fd)
### def test_close_does_not_close_fd (self):
### '''Calling close() on a pexpect.spawn object should not
### close the underlying file descriptor.
### '''
### fd = os.open ('TESTDATA.txt', os.O_RDONLY)
### s = pexpect.spawn (fd)
### try:
### s.close()
### self.fail('Expected an Exception.')
### except pexpect.ExceptionPexpect, e:
### pass
评论列表
文章目录