mirror of
https://github.com/romanz/amodem.git
synced 2026-03-30 23:57:54 +08:00
fix test_stream
aplay/arecord should not be tested
This commit is contained in:
@@ -1,13 +1,26 @@
|
||||
from amodem import stream
|
||||
from amodem import wave
|
||||
import subprocess as sp
|
||||
|
||||
script = r"""
|
||||
import sys
|
||||
import time
|
||||
import os
|
||||
|
||||
while True:
|
||||
time.sleep(0.1)
|
||||
sys.stdout.write(b'\x00' * 6400)
|
||||
sys.stderr.write('.')
|
||||
"""
|
||||
|
||||
|
||||
def test():
|
||||
p = wave.record('-', stdout=wave.sp.PIPE)
|
||||
def test_read():
|
||||
p = sp.Popen(args=['python', '-'], stdin=sp.PIPE, stdout=sp.PIPE)
|
||||
p.stdin.write(script)
|
||||
p.stdin.close()
|
||||
f = stream.Reader(p.stdout)
|
||||
|
||||
result = zip(range(10), f)
|
||||
p.stop()
|
||||
p.kill()
|
||||
|
||||
j = 0
|
||||
for i, buf in result:
|
||||
|
||||
Reference in New Issue
Block a user