add hg and python
This commit is contained in:
parent
3a742c699f
commit
458120dd40
3709 changed files with 1244309 additions and 1 deletions
19
sys/lib/python/test/test_openpty.py
Normal file
19
sys/lib/python/test/test_openpty.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Test to see if openpty works. (But don't worry if it isn't available.)
|
||||
|
||||
import os
|
||||
from test.test_support import verbose, TestFailed, TestSkipped
|
||||
|
||||
try:
|
||||
if verbose:
|
||||
print "Calling os.openpty()"
|
||||
master, slave = os.openpty()
|
||||
if verbose:
|
||||
print "(master, slave) = (%d, %d)"%(master, slave)
|
||||
except AttributeError:
|
||||
raise TestSkipped, "No openpty() available."
|
||||
|
||||
if not os.isatty(slave):
|
||||
raise TestFailed, "Slave-end of pty is not a terminal."
|
||||
|
||||
os.write(slave, 'Ping!')
|
||||
print os.read(master, 1024)
|
Loading…
Add table
Add a link
Reference in a new issue