stream: move Dumper class from recv and use it in calibration too

This commit is contained in:
Roman Zeyde
2015-02-01 17:37:25 +02:00
parent bfbb7f3588
commit 66b8e377ac
4 changed files with 19 additions and 14 deletions

View File

@@ -144,8 +144,10 @@ def test_recv_binary_search():
calib.send(config, buf, gain=gain, limit=2)
buf.seek(0)
dump = BytesIO()
with mock.patch('subprocess.check_call') as check_call:
calib.recv(config, src=buf, volume_cmd='ctl')
calib.recv(config, src=buf, volume_cmd='ctl', dump_audio=dump)
assert dump.getvalue() == buf.getvalue()
gains.append(gains[-1])
fmt = 'ctl {0:.0f}%'