Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(116215)

Side by Side Diff: Lib/test/test_pty.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_posix.py ('k') | Lib/test/test_quopri.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 from test.support import verbose, import_module, reap_children 1 from test.support import verbose, import_module, reap_children
2 2
3 # Skip these tests if termios is not available 3 # Skip these tests if termios is not available
4 import_module('termios') 4 import_module('termios')
5 5
6 import errno 6 import errno
7 import pty 7 import pty
8 import os 8 import os
9 import sys 9 import sys
10 import select 10 import select
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 debug("Writing chunked output") 105 debug("Writing chunked output")
106 os.write(slave_fd, TEST_STRING_2[:5]) 106 os.write(slave_fd, TEST_STRING_2[:5])
107 os.write(slave_fd, TEST_STRING_2[5:]) 107 os.write(slave_fd, TEST_STRING_2[5:])
108 s2 = os.read(master_fd, 1024) 108 s2 = os.read(master_fd, 1024)
109 self.assertEqual(b'For my pet fish, Eric.\n', normalize_output(s2)) 109 self.assertEqual(b'For my pet fish, Eric.\n', normalize_output(s2))
110 110
111 os.close(slave_fd) 111 os.close(slave_fd)
112 os.close(master_fd) 112 os.close(master_fd)
113 113
114 114 @unittest.skipUnless(hasattr(os, 'fork'), "test requires os.fork()")
115 def test_fork(self): 115 def test_fork(self):
116 debug("calling pty.fork()") 116 debug("calling pty.fork()")
117 pid, master_fd = pty.fork() 117 pid, master_fd = pty.fork()
118 if pid == pty.CHILD: 118 if pid == pty.CHILD:
119 # stdout should be connected to a tty. 119 # stdout should be connected to a tty.
120 if not os.isatty(1): 120 if not os.isatty(1):
121 debug("Child's fd 1 is not a tty?!") 121 debug("Child's fd 1 is not a tty?!")
122 os._exit(3) 122 os._exit(3)
123 123
124 # After pty.fork(), the child should already be a session leader. 124 # After pty.fork(), the child should already be a session leader.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 with self.assertRaises(IndexError): 292 with self.assertRaises(IndexError):
293 pty._copy(masters[0]) 293 pty._copy(masters[0])
294 294
295 295
296 def tearDownModule(): 296 def tearDownModule():
297 reap_children() 297 reap_children()
298 298
299 if __name__ == "__main__": 299 if __name__ == "__main__":
300 unittest.main() 300 unittest.main()
OLDNEW
« no previous file with comments | « Lib/test/test_posix.py ('k') | Lib/test/test_quopri.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+