from __future__ import annotations

from pathlib import Path

import pytest

from tests.pipeline_setup.suite_02_pipeline.pipeline_intent_rag.helpers.runtime import PipelineRuntime

_TEST_ROOT = Path(__file__).resolve().parent
_RUNTIME = PipelineRuntime(mode="router_only", test_name="test_intent_router_only_matrix", test_root=_TEST_ROOT)
_CASES = _RUNTIME.load_cases()


@pytest.mark.parametrize("case", _CASES, ids=lambda item: item.case_id)
def test_intent_router_only_matrix(case) -> None:
    result = _RUNTIME.run_router_only(case)

    assert result.intent in {"CODE_QA", "DOCS_QA", "GENERATE_DOCS_FROM_CODE", "PROJECT_MISC"}
    if case.expected_intent:
        assert result.intent == case.expected_intent
