fix: Apply Black formatting to test_market_analyst.py

- Changed single quotes to double quotes in @patch decorators
- Ensures Code Quality checks pass

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
佐藤優一 2025-08-11 12:21:50 +09:00
parent a6e7f383e8
commit 55f0b18693
1 changed files with 22 additions and 18 deletions

View File

@ -17,7 +17,7 @@ class TestMarketAnalyst:
analyst_node = create_market_analyst(mock_llm, mock_toolkit)
assert callable(analyst_node)
@patch('tradingagents.agents.analysts.market_analyst.ChatPromptTemplate')
@patch("tradingagents.agents.analysts.market_analyst.ChatPromptTemplate")
def test_market_analyst_node_basic_execution(
self,
mock_prompt_template,
@ -48,7 +48,7 @@ class TestMarketAnalyst:
assert result["messages"] == [mock_result]
assert result["market_report"] == "Market analysis complete"
@patch('tradingagents.agents.analysts.market_analyst.ChatPromptTemplate')
@patch("tradingagents.agents.analysts.market_analyst.ChatPromptTemplate")
def test_market_analyst_uses_online_tools_when_configured(
self,
mock_prompt_template,
@ -78,7 +78,7 @@ class TestMarketAnalyst:
# Verify - just check that the function completes without error
# bind_tools is a function mock, not a Mock object, so we can't assert calls
@patch('tradingagents.agents.analysts.market_analyst.ChatPromptTemplate')
@patch("tradingagents.agents.analysts.market_analyst.ChatPromptTemplate")
def test_market_analyst_uses_offline_tools_when_configured(
self,
mock_prompt_template,
@ -108,7 +108,7 @@ class TestMarketAnalyst:
# Verify - just check that the function completes without error
# bind_tools is a function mock, not a Mock object, so we can't assert calls
@patch('tradingagents.agents.analysts.market_analyst.ChatPromptTemplate')
@patch("tradingagents.agents.analysts.market_analyst.ChatPromptTemplate")
def test_market_analyst_processes_state_variables(
self,
mock_prompt_template,
@ -138,10 +138,12 @@ class TestMarketAnalyst:
result = analyst_node(sample_agent_state)
# Verify that invoke was called with the state
mock_llm._chain_mock.invoke.assert_called_once_with(sample_agent_state["messages"])
mock_llm._chain_mock.invoke.assert_called_once_with(
sample_agent_state["messages"]
)
assert result["market_report"] == "Analysis for AAPL on 2024-05-10"
@patch('tradingagents.agents.analysts.market_analyst.ChatPromptTemplate')
@patch("tradingagents.agents.analysts.market_analyst.ChatPromptTemplate")
def test_market_analyst_handles_empty_tool_calls(
self,
mock_prompt_template,
@ -172,7 +174,7 @@ class TestMarketAnalyst:
assert result["market_report"] == "No tools needed"
assert result["messages"] == [mock_result]
@patch('tradingagents.agents.analysts.market_analyst.ChatPromptTemplate')
@patch("tradingagents.agents.analysts.market_analyst.ChatPromptTemplate")
def test_market_analyst_with_tool_calls(
self,
mock_prompt_template,
@ -204,7 +206,7 @@ class TestMarketAnalyst:
assert result["messages"] == [mock_result]
@pytest.mark.parametrize("online_tools", [True, False])
@patch('tradingagents.agents.analysts.market_analyst.ChatPromptTemplate')
@patch("tradingagents.agents.analysts.market_analyst.ChatPromptTemplate")
def test_market_analyst_tool_configuration(
self,
mock_prompt_template,
@ -242,8 +244,10 @@ class TestMarketAnalyst:
class TestMarketAnalystIntegration:
"""Integration-style tests for market analyst."""
@patch('tradingagents.agents.analysts.market_analyst.ChatPromptTemplate')
def test_market_analyst_full_workflow(self, mock_prompt_template, mock_llm, mock_toolkit):
@patch("tradingagents.agents.analysts.market_analyst.ChatPromptTemplate")
def test_market_analyst_full_workflow(
self, mock_prompt_template, mock_llm, mock_toolkit
):
"""Test a complete workflow simulation."""
# Setup mock for ChatPromptTemplate
mock_prompt = Mock()