Test for Soren's subprocess fix. Fixes #77

This commit is contained in:
Ryan Williams
2011-02-15 17:02:25 -08:00
parent cead243901
commit 5becce8f6f
2 changed files with 15 additions and 0 deletions

View File

@@ -70,3 +70,4 @@ Thanks To
* Edward George, finding and fixing an issue in the [e]poll hubs (#74) * Edward George, finding and fixing an issue in the [e]poll hubs (#74)
* Ruijun Luo, figuring out incorrect openssl import for wrap_ssl (#73) * Ruijun Luo, figuring out incorrect openssl import for wrap_ssl (#73)
* rfk, patch to get green zmq to respect noblock flag. * rfk, patch to get green zmq to respect noblock flag.
* Soren Hansen, finding and fixing issue in subprocess (#77)

View File

@@ -279,5 +279,19 @@ import time
self.assertEqual(len(lines), 2, "\n".join(lines)) self.assertEqual(len(lines), 2, "\n".join(lines))
class Subprocess(ProcessBase):
def test_monkeypatched_subprocess(self):
new_mod = """import eventlet
eventlet.monkey_patch()
from eventlet.green import subprocess
subprocess.Popen(['/bin/true'], stdin=subprocess.PIPE)
print "done"
"""
self.write_to_tempfile("newmod", new_mod)
output, lines = self.launch_subprocess('newmod')
self.assertEqual(output, "done\n", output)
if __name__ == '__main__': if __name__ == '__main__':
main() main()