fix(simulation): accept ROS multi-document samples

This commit is contained in:
DCCONSTRUCTIONS 2026-07-24 17:21:04 +03:00
parent fc5cbdff8a
commit 2548bb5740
1 changed files with 7 additions and 3 deletions

View File

@ -47,10 +47,14 @@ def _load_json(path: Path) -> dict[str, Any]:
def _load_yaml(path: Path) -> dict[str, Any]: def _load_yaml(path: Path) -> dict[str, Any]:
loaded = yaml.safe_load(path.read_text(encoding="utf-8")) documents = [
if not isinstance(loaded, dict): 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}") raise EvidenceError(f"expected a YAML mapping: {path}")
return loaded return documents[0]
def _result_env(path: Path) -> dict[str, str]: def _result_env(path: Path) -> dict[str, str]: