fix(resources): guard non-dict YAML in load_profile; remove unused FIXTURES constant

This commit is contained in:
pyr0ball 2026-03-30 20:30:30 -07:00
parent c6a58b6a37
commit bfc1f7b7b9
2 changed files with 2 additions and 3 deletions

View file

@ -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(

View file

@ -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 = """