MCPcopy Index your code
hub / github.com/RustPython/RustPython / test

Method test

Lib/test/test_openpty.py:10–18  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8
9class OpenptyTest(unittest.TestCase):
10 def test(self):
11 master, slave = os.openpty()
12 self.addCleanup(os.close, master)
13 self.addCleanup(os.close, slave)
14 if not os.isatty(slave):
15 self.fail("Slave-end of pty is not a terminal.")
16
17 os.write(slave, b'Ping!')
18 self.assertEqual(os.read(master, 1024), b'Ping!')
19
20if __name__ == '__main__':
21 unittest.main()

Callers

nothing calls this directly

Calls 6

addCleanupMethod · 0.80
isattyMethod · 0.45
failMethod · 0.45
writeMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected