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

13 lines
419 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()