diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-04 05:41:33 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-04 05:41:33 +0000 |
commit | b8436b026a90291ba26afa4f7a2700720b03339f (patch) | |
tree | 3098aede87640c80567ecb31022e0404a8b5ec75 /sys/lib/python/test/test_ioctl.py | |
parent | 6c1b42188259a6f1636cd15a9570b18af03e2dbb (diff) |
remove python test cases
Diffstat (limited to 'sys/lib/python/test/test_ioctl.py')
-rw-r--r-- | sys/lib/python/test/test_ioctl.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/sys/lib/python/test/test_ioctl.py b/sys/lib/python/test/test_ioctl.py deleted file mode 100644 index 2b127e2b4..000000000 --- a/sys/lib/python/test/test_ioctl.py +++ /dev/null @@ -1,41 +0,0 @@ -import unittest -from test.test_support import TestSkipped, run_unittest -import os, struct -try: - import fcntl, termios -except ImportError: - raise TestSkipped("No fcntl or termios module") -if not hasattr(termios,'TIOCGPGRP'): - raise TestSkipped("termios module doesn't have TIOCGPGRP") - -try: - tty = open("/dev/tty", "r") - tty.close() -except IOError: - raise TestSkipped("Unable to open /dev/tty") - -class IoctlTests(unittest.TestCase): - def test_ioctl(self): - # If this process has been put into the background, TIOCGPGRP returns - # the session ID instead of the process group id. - ids = (os.getpgrp(), os.getsid(0)) - tty = open("/dev/tty", "r") - r = fcntl.ioctl(tty, termios.TIOCGPGRP, " ") - rpgrp = struct.unpack("i", r)[0] - self.assert_(rpgrp in ids, "%s not in %s" % (rpgrp, ids)) - - def test_ioctl_mutate(self): - import array - buf = array.array('i', [0]) - ids = (os.getpgrp(), os.getsid(0)) - tty = open("/dev/tty", "r") - r = fcntl.ioctl(tty, termios.TIOCGPGRP, buf, 1) - rpgrp = buf[0] - self.assertEquals(r, 0) - self.assert_(rpgrp in ids, "%s not in %s" % (rpgrp, ids)) - -def test_main(): - run_unittest(IoctlTests) - -if __name__ == "__main__": - test_main() |