support/testing: add test for python-distro

This commit add a simple test checking the reported distro name and
id are Buildroot (as reported by /etc/os-release).

Signed-off-by: Julien Olivain <ju.o@free.fr>
[Arnout: drop python2 variant]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Julien Olivain 2022-01-30 18:21:45 +01:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent 59d3a1a999
commit ebde11d29f
3 changed files with 17 additions and 0 deletions

View File

@ -1604,7 +1604,9 @@ F: package/python-gnupg/
F: package/python-pyalsa/
F: package/riscv-isa-sim/
F: package/zynaddsubfx/
F: support/testing/tests/package/sample_python_distro.py
F: support/testing/tests/package/sample_python_gnupg.py
F: support/testing/tests/package/test_python_distro.py
F: support/testing/tests/package/test_python_gnupg.py
N: Julien Viard de Galbert <julien@vdg.name>

View File

@ -0,0 +1,4 @@
import distro
assert(distro.name() == 'Buildroot')
assert(distro.id() == 'buildroot')

View File

@ -0,0 +1,11 @@
from tests.package.test_python import TestPythonPackageBase
class TestPythonPy3Distro(TestPythonPackageBase):
__test__ = True
config = TestPythonPackageBase.config + \
"""
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_DISTRO=y
"""
sample_scripts = ["tests/package/sample_python_distro.py"]