Skip to content
Snippets Groups Projects
Verified Commit 7c21f20f authored by Daniel Hornung's avatar Daniel Hornung
Browse files

TEST: Better yaml parser error.

parent 3cfc137a
No related branches found
No related tags found
2 merge requests!89ENH: JsonSchemaExporter accepts do_not_create parameter.,!75F better parser error
Pipeline #39852 passed
......@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ###
* A bit better error handling in the yaml model parser.
### Deprecated ###
### Removed ###
......
......@@ -32,7 +32,7 @@ from caosadvancedtools.converter import labfolder_export as labfolder
def main(args):
"""The main function."""
model = parse_model_from_yaml("./model.yml")
model = parse_model_from_yaml("./models/model.yml")
model.sync_data_model()
labfolder.import_data(args.folder)
......
......@@ -31,7 +31,7 @@ from caosadvancedtools.converter.labfolder_api import Importer
def main(args):
"""The main function."""
model = parse_model_from_yaml("./model.yml")
model = parse_model_from_yaml("./models/model.yml")
# model.sync_data_model()
importer = Importer()
......
File moved
Project:
ObligatoryProperties:
......@@ -511,3 +511,11 @@ R3:
# Until removal, both do the same
assert has_parent(r3, par)
assert r3.get_parent(par)._flags["inheritance"] == db.OBLIGATORY
def test_yaml_error():
"""Testing error while parsing a yaml.
"""
with raises(ValueError, match=r"line 2: .*"):
parse_model_from_yaml("unittests/models/model_invalid.yml")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment