mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 14:01:57 -09:00
package/python-segno: new package
segno 1.5.2 https://pypi.org/project/segno/ Signed-off-by: Witold Lipieta <witold.lipieta@thaumatec.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
bdb15addcb
commit
7412789bfd
13
support/testing/tests/package/sample_python_segno.py
Normal file
13
support/testing/tests/package/sample_python_segno.py
Normal file
@@ -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
|
||||
11
support/testing/tests/package/test_python_segno.py
Normal file
11
support/testing/tests/package/test_python_segno.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from tests.package.test_python import TestPythonPackageBase
|
||||
|
||||
|
||||
class TestPythonPy3Segno(TestPythonPackageBase):
|
||||
__test__ = True
|
||||
config = TestPythonPackageBase.config + \
|
||||
"""
|
||||
BR2_PACKAGE_PYTHON3=y
|
||||
BR2_PACKAGE_PYTHON_SEGNO=y
|
||||
"""
|
||||
sample_scripts = ["tests/package/sample_python_segno.py"]
|
||||
Reference in New Issue
Block a user