package/python-ruamel-yaml-clib: new package
Add optional c extension for python-ruamel-yaml which can speed up yaml loading/parsing. Extend the ruamel-yaml runtime test to check if the c extension works correctly. 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
21da0df09d
commit
f538c7e6bd
@@ -25,3 +25,15 @@ parsed = yaml.load(yaml_text)
|
||||
|
||||
assert parsed['OneMoreRootKey'] == 9.99
|
||||
assert parsed['ListRoot'][1]['another-int'] == 1111
|
||||
|
||||
# Tests the C extension based loader
|
||||
# ruamel.yaml automatically falls back to the pure python version, so we need
|
||||
# to explicitly check if importing the CLoader works here.
|
||||
# Import this here, so it's clearer what part of the test is failing.
|
||||
from ruamel.yaml import CLoader # noqa: E402
|
||||
assert CLoader is not None
|
||||
yaml = YAML(typ='safe')
|
||||
parsed_from_c = yaml.load(yaml_text)
|
||||
|
||||
assert parsed_from_c['OneMoreRootKey'] == 9.99
|
||||
assert parsed_from_c['ListRoot'][1]['another-int'] == 1111
|
||||
|
||||
Reference in New Issue
Block a user