Files
wehub-resource-sync 8b3317e15b
CI / tests (py3.12) (push) Failing after 0s
CI / tests (py3.11) (push) Failing after 0s
CI / tests (py3.10) (push) Failing after 2s
CI / clean-install smoke (push) Failing after 1s
CI / ruff (strict, full repo) (push) Failing after 1s
CI / tests (py3.13) (push) Failing after 3s
chore: import upstream snapshot with attribution
2026-07-13 11:58:51 +08:00

24 lines
1014 B
Python

"""The market analyst is bound (and prompt-instructed) to call
get_verified_market_snapshot; if the executor ToolNode doesn't register it, the
call fails and the model reports the tool "unavailable" and skips verification.
Regression guard for that wiring gap (snapshot bound to the LLM but missing from
the market ToolNode).
"""
import pytest
from tradingagents.graph.trading_graph import TradingAgentsGraph
@pytest.mark.unit
def test_market_toolnode_can_execute_verified_snapshot():
# _create_tool_nodes does not use self -> call unbound (avoids building LLMs).
nodes = TradingAgentsGraph._create_tool_nodes(None)
market_tools = set(nodes["market"].tools_by_name)
assert "get_verified_market_snapshot" in market_tools, (
"get_verified_market_snapshot is bound to the market analyst but not "
"registered in the market ToolNode, so the model's call fails."
)
# the other core market tools must remain too
assert {"get_stock_data", "get_indicators"} <= market_tools