"""Conformance runner tests: runs the declarative scenarios from the spec repo.""" from __future__ import annotations from pathlib import Path import pytest from aicc.conformance import reference_bridge, run_scenarios, summarize SCENARIOS = Path(__file__).resolve().parents[1] / ".." / "aicc-spec" / "conformance" / "scenarios" @pytest.mark.asyncio async def test_core_scenarios_pass(): if not SCENARIOS.exists(): pytest.skip("AICC-Protocol conformance scenarios not found on this machine") bridge = reference_bridge() results = await run_scenarios(bridge, SCENARIOS) report = summarize(results) assert all(r.passed for r in results), report @pytest.mark.asyncio async def test_runner_rejects_unknown_tool(): """A bridge missing a required tool fails the corresponding scenario.""" from aicc import Bridge bridge = Bridge(name="incomplete") results = await run_scenarios(bridge, SCENARIOS) by_id = {r.id: r for r in results} # echo tool missing -> core-03 must fail assert not by_id["core-03-tool-call-ok"].passed