diff --git a/circuitforge_core/resources/profiles/schema.py b/circuitforge_core/resources/profiles/schema.py index f3cc808..ac59020 100644 --- a/circuitforge_core/resources/profiles/schema.py +++ b/circuitforge_core/resources/profiles/schema.py @@ -55,6 +55,8 @@ class GpuProfile(BaseModel): def load_profile(path: Path) -> GpuProfile: raw: dict[str, Any] = yaml.safe_load(path.read_text()) + if not isinstance(raw, dict): + raise ValueError(f"Profile file {path} must be a YAML mapping, got {type(raw).__name__}") version = raw.get("schema_version") if version != SUPPORTED_SCHEMA_VERSION: raise ValueError( diff --git a/tests/test_resources/test_profile_registry.py b/tests/test_resources/test_profile_registry.py index 4e808ff..5265bc0 100644 --- a/tests/test_resources/test_profile_registry.py +++ b/tests/test_resources/test_profile_registry.py @@ -1,12 +1,9 @@ # tests/test_resources/test_profile_registry.py import pytest -from pathlib import Path from circuitforge_core.resources.profiles.schema import ( GpuProfile, ServiceProfile, load_profile ) -FIXTURES = Path(__file__).parent / "fixtures" - def test_load_8gb_profile(tmp_path): yaml_content = """