fix(simulation): accept ROS multi-document samples
This commit is contained in:
parent
fc5cbdff8a
commit
2548bb5740
|
|
@ -47,10 +47,14 @@ def _load_json(path: Path) -> dict[str, Any]:
|
|||
|
||||
|
||||
def _load_yaml(path: Path) -> dict[str, Any]:
|
||||
loaded = yaml.safe_load(path.read_text(encoding="utf-8"))
|
||||
if not isinstance(loaded, dict):
|
||||
documents = [
|
||||
document
|
||||
for document in yaml.safe_load_all(path.read_text(encoding="utf-8"))
|
||||
if document is not None
|
||||
]
|
||||
if len(documents) != 1 or not isinstance(documents[0], dict):
|
||||
raise EvidenceError(f"expected a YAML mapping: {path}")
|
||||
return loaded
|
||||
return documents[0]
|
||||
|
||||
|
||||
def _result_env(path: Path) -> dict[str, str]:
|
||||
|
|
|
|||
Loading…
Reference in New Issue