mirror of
https://github.com/romanz/amodem.git
synced 2026-03-31 08:06:50 +08:00
test_audio: improve coverage
This commit is contained in:
@@ -4,9 +4,10 @@ import signal
|
||||
|
||||
|
||||
def test_launch():
|
||||
p = audio.ALSA(tool='true', Fs=32000).launch(fname='fname')
|
||||
p = audio.ALSA(tool='true', Fs=32000).launch()
|
||||
assert p.wait() == 0
|
||||
|
||||
|
||||
def test_exit():
|
||||
p = audio.ALSA(tool='python', Fs=32000).launch(fname='-', stdin=sp.PIPE)
|
||||
s = b'import sys; sys.exit(42)'
|
||||
@@ -14,6 +15,7 @@ def test_exit():
|
||||
p.stdin.close()
|
||||
assert p.wait() == 42
|
||||
|
||||
|
||||
def test_io():
|
||||
p = audio.ALSA(tool='python', Fs=32000)
|
||||
p = p.launch(fname='-', stdin=sp.PIPE, stdout=sp.PIPE)
|
||||
@@ -22,6 +24,7 @@ def test_io():
|
||||
p.stdin.close()
|
||||
assert p.stdout.read(len(s)) == s
|
||||
|
||||
|
||||
def test_kill():
|
||||
p = audio.ALSA(tool='python', Fs=32000)
|
||||
p = p.launch(fname='-', stdin=sp.PIPE, stdout=sp.PIPE)
|
||||
|
||||
Reference in New Issue
Block a user