+++ /dev/null
-# Test to see if openpty works. (But don't worry if it isn't available.)\r
-\r
-import os, unittest\r
-from test.test_support import run_unittest\r
-\r
-if not hasattr(os, "openpty"):\r
- raise unittest.SkipTest, "No openpty() available."\r
-\r
-\r
-class OpenptyTest(unittest.TestCase):\r
- def test(self):\r
- master, slave = os.openpty()\r
- if not os.isatty(slave):\r
- self.fail("Slave-end of pty is not a terminal.")\r
-\r
- os.write(slave, 'Ping!')\r
- self.assertEqual(os.read(master, 1024), 'Ping!')\r
-\r
-def test_main():\r
- run_unittest(OpenptyTest)\r
-\r
-if __name__ == '__main__':\r
- test_main()\r