mirror of
https://gitee.com/open-loongarch/buildroot-2024.08.git
synced 2026-10-28 22:17:12 +08:00
first commit: base 2024.08
Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import segno
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
qr = segno.make_qr('http:/www.example.org/')
|
||||
with tempfile.NamedTemporaryFile('wb', suffix='.png', delete=False) as f:
|
||||
fn = f.name
|
||||
qr.save(fn)
|
||||
expected = b'\211PNG\r\n\032\n' # PNG magic number
|
||||
with open(fn, mode='rb') as f:
|
||||
val = f.read(len(expected))
|
||||
os.unlink(fn)
|
||||
assert expected == val
|
||||
Reference in New Issue
Block a user