def test_output2():
out = io.BytesIO()
segno.make_qr('Good Times', error='M').save(out, kind='png', scale=10, color='red')
f = tempfile.NamedTemporaryFile('w', suffix='.png', delete=False)
f.close()
cli.main(['-e=M', '--scale=10', '--color=red', '--output={0}'.format(f.name), 'Good', 'Times'])
f = open(f.name, 'rb')
content = f.read()
f.close()
os.unlink(f.name)
assert out.getvalue() == content
评论列表
文章目录