tests: Pythonize write_all_consumer.py

This commit is contained in:
David Wilson 2018-10-30 23:12:16 +00:00
parent f53e7dd637
commit 48e8f1f7aa
3 changed files with 10 additions and 8 deletions

View File

@ -0,0 +1,9 @@
#!/usr/bin/env python
# I consume 65535 bytes every 10ms, for testing mitogen.core.write_all()
import os
import time
while True:
os.read(0, 65535)
time.sleep(0.01)

View File

@ -1,7 +0,0 @@
#!/bin/bash
# I consume 65535 bytes every 10ms, for testing mitogen.core.write_all()
while :; do
read -n 65535
sleep 0.01
done

View File

@ -267,7 +267,7 @@ class WriteAllTest(unittest2.TestCase):
func = staticmethod(mitogen.parent.write_all)
def make_proc(self):
args = [testlib.data_path('write_all_consumer.sh')]
args = [testlib.data_path('write_all_consumer.py')]
proc = subprocess.Popen(args, stdin=subprocess.PIPE)
mitogen.core.set_nonblock(proc.stdin.fileno())
return proc