mirror of
https://github.com/romanz/amodem.git
synced 2026-03-17 07:05:59 +08:00
fix wave tools
This commit is contained in:
@@ -4,19 +4,19 @@ import signal
|
||||
|
||||
|
||||
def test_launch():
|
||||
p = wave.launch('cat', stdin=sp.PIPE)
|
||||
p.stdin.close()
|
||||
p = wave.launch(tool='true', fname='fname')
|
||||
assert p.wait() == 0
|
||||
|
||||
p = wave.launch('bash', stdin=sp.PIPE)
|
||||
p.stdin.write(b'exit 42')
|
||||
p = wave.launch(tool='python', fname='-', stdin=sp.PIPE)
|
||||
s = b'import sys; sys.exit(42)'
|
||||
p.stdin.write(s)
|
||||
p.stdin.close()
|
||||
assert p.wait() == 42
|
||||
|
||||
p = wave.launch('cat', stdin=sp.PIPE, stdout=sp.PIPE)
|
||||
p = wave.launch(tool='python', fname='-', stdin=sp.PIPE, stdout=sp.PIPE)
|
||||
s = b'Hello World!'
|
||||
p.stdin.write(s)
|
||||
p.stdin.flush()
|
||||
p.stdin.write(b'print("' + s + b'")\n')
|
||||
p.stdin.close()
|
||||
assert p.stdout.read(len(s)) == s
|
||||
|
||||
p.kill()
|
||||
|
||||
Reference in New Issue
Block a user