mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 22:11:59 -09:00
support/testing: add new python-ruamel-yaml runtime test
Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
9fb8f2e10c
commit
21da0df09d
@@ -2158,7 +2158,9 @@ F: utils/diffconfig
|
|||||||
N: Marcus Hoffmann <bubu@bubu1.eu>
|
N: Marcus Hoffmann <bubu@bubu1.eu>
|
||||||
F: package/python-jc/
|
F: package/python-jc/
|
||||||
F: support/testing/tests/package/test_python_fastapi.py
|
F: support/testing/tests/package/test_python_fastapi.py
|
||||||
|
F: support/testing/tests/package/test_python_ruamel_yaml.py
|
||||||
F: support/testing/tests/package/sample_python_fastapi.py
|
F: support/testing/tests/package/sample_python_fastapi.py
|
||||||
|
F: support/testing/tests/package/sample_python_ruamel_yaml.py
|
||||||
|
|
||||||
N: Marek Belisko <marek.belisko@open-nandra.com>
|
N: Marek Belisko <marek.belisko@open-nandra.com>
|
||||||
F: package/libatasmart/
|
F: package/libatasmart/
|
||||||
|
|||||||
27
support/testing/tests/package/sample_python_ruamel_yaml.py
Normal file
27
support/testing/tests/package/sample_python_ruamel_yaml.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
from ruamel.yaml import YAML
|
||||||
|
|
||||||
|
yaml_text = """
|
||||||
|
Rootkey:
|
||||||
|
- ListEntry
|
||||||
|
AnotherRootKey: some-string
|
||||||
|
|
||||||
|
ListRoot:
|
||||||
|
- float-value: '1.0'
|
||||||
|
int-value: 10234
|
||||||
|
NestedList:
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
|
||||||
|
- another-float: '1.1'
|
||||||
|
another-int: 1111
|
||||||
|
|
||||||
|
OneMoreRootKey: 9.99
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Tests the pure python based implementation
|
||||||
|
yaml = YAML(typ='safe', pure=True)
|
||||||
|
|
||||||
|
parsed = yaml.load(yaml_text)
|
||||||
|
|
||||||
|
assert parsed['OneMoreRootKey'] == 9.99
|
||||||
|
assert parsed['ListRoot'][1]['another-int'] == 1111
|
||||||
12
support/testing/tests/package/test_python_ruamel_yaml.py
Normal file
12
support/testing/tests/package/test_python_ruamel_yaml.py
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
from tests.package.test_python import TestPythonPackageBase
|
||||||
|
|
||||||
|
|
||||||
|
class TestPythonPy3RuamelYaml(TestPythonPackageBase):
|
||||||
|
__test__ = True
|
||||||
|
config = TestPythonPackageBase.config + \
|
||||||
|
"""
|
||||||
|
BR2_PACKAGE_PYTHON3=y
|
||||||
|
BR2_PACKAGE_PYTHON_RUAMEL_YAML=y
|
||||||
|
"""
|
||||||
|
sample_scripts = ["tests/package/sample_python_ruamel_yaml.py"]
|
||||||
|
timeout = 40
|
||||||
Reference in New Issue
Block a user