Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
761cd9ea
Commit
761cd9ea
authored
Mar 29, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: import tty_create_child_test.py.
parent
7b12f843
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
tests/tty_create_child_test.py
tests/tty_create_child_test.py
+34
-0
No files found.
tests/tty_create_child_test.py
0 → 100644
View file @
761cd9ea
import
os
import
tempfile
import
time
import
unittest2
import
mitogen.parent
class
TtyCreateChildTest
(
unittest2
.
TestCase
):
func
=
staticmethod
(
mitogen
.
parent
.
tty_create_child
)
def
test_dev_tty_open_succeeds
(
self
):
import
logging
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
tf
=
tempfile
.
NamedTemporaryFile
()
try
:
pid
,
fd
=
self
.
func
(
'bash'
,
'-c'
,
'exec 2>%s; echo hi > /dev/tty'
%
(
tf
.
name
,)
)
# TODO: this waitpid hangs on OS X. Installing a SIGCHLD handler
# reveals the parent /is/ notified of the child's death, but
# calling waitpid() from within SIGCHLD yields "No such processes".
# Meanwhile, even inserting a sleep, the following call will hang.
waited_pid
,
status
=
os
.
waitpid
(
pid
,
0
)
self
.
assertEquals
(
pid
,
waited_pid
)
self
.
assertEquals
(
0
,
status
)
self
.
assertEquals
(
''
,
tf
.
read
())
finally
:
tf
.
close
()
if
__name__
==
'__main__'
:
unittest2
.
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment