Skip to content

Commit 95e24c9

Browse files
fix use spec=textblock in mock
1 parent a87a9cb commit 95e24c9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/test_providers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ async def test_anthropic_provider_parses_result():
3232
with patch("ai_reviewer.providers.anthropic.anthropic.AsyncAnthropic") as mock_cls:
3333
mock_client = MagicMock()
3434
mock_cls.return_value = mock_client
35+
mock_block = MagicMock(spec=TextBlock, text=json.dumps(MOCK_RESULT))
3536
mock_client.messages.create = AsyncMock(
36-
return_value=MagicMock(content=[MagicMock(spec=TextBlock, text=json.dumps(MOCK_RESULT))])
37+
return_value=MagicMock(content=[mock_block])
3738
)
3839

3940
provider = AnthropicProvider(api_key="test-key", model="claude-sonnet-4-20250514")

0 commit comments

Comments
 (0)