fix(simulation): accept ROS multi-document samples
This commit is contained in:
@@ -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]:
|
||||||
|
|||||||
Reference in New Issue
Block a user