discovery-by-llm/backend/tests/test_anthropic_llm.py

13 lines
421 B
Python

"""Focused tests for Anthropic response parsing."""
import pytest
from app.adapters.anthropic.llm import _RecommendationObjectParser
from app.ports.protocols import RecommenderOutputError
def test_parser_missing_object_start_raises_typed_output_error() -> None:
parser = _RecommendationObjectParser()
with pytest.raises(RecommenderOutputError, match="object start position"):
parser._finish_object()