mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-09-27 06:56:39 +03:00
- display.py holds the message buffer, layout, status tables and report panels, the analyst wall-time tracker (CLI-only, from graph/analyst_execution) and the one Console - utils.py is renamed prompts.py, which is what it holds; its analyst list is ANALYST_CHOICES, apart from display's ANALYST_ORDER - get_initial_analyst_node, a one-line helper with one caller, is inlined - the wall-time tracker tests sit with the other display tests, and tests import cli.prompts as prompts
31 lines
1.3 KiB
Python
31 lines
1.3 KiB
Python
import unittest
|
|
|
|
from tradingagents.graph.analyst_execution import (
|
|
build_analyst_execution_plan,
|
|
)
|
|
|
|
|
|
class AnalystExecutionPlanTests(unittest.TestCase):
|
|
def test_build_plan_preserves_selected_order(self):
|
|
plan = build_analyst_execution_plan(["news", "market"])
|
|
|
|
self.assertEqual([spec.key for spec in plan.specs], ["news", "market"])
|
|
self.assertEqual(plan.specs[0].agent_node, "News Analyst")
|
|
self.assertEqual(plan.specs[0].tool_node, "tools_news")
|
|
self.assertEqual(plan.specs[0].clear_node, "Msg Clear News")
|
|
|
|
def test_rejects_unknown_analyst_keys(self):
|
|
with self.assertRaises(ValueError):
|
|
build_analyst_execution_plan(["market", "macro"])
|
|
|
|
def test_social_key_displays_as_sentiment_analyst(self):
|
|
# The wire key stays "social" for saved-config back-compat, but the
|
|
# user-visible agent_node label must match the v0.2.5 rename so the
|
|
# wall-time summary and any future consumer of agent_node says
|
|
# "Sentiment Analyst" rather than the legacy "Social Analyst".
|
|
plan = build_analyst_execution_plan(["social"])
|
|
spec = plan.specs[0]
|
|
self.assertEqual(spec.key, "social")
|
|
self.assertEqual(spec.agent_node, "Sentiment Analyst")
|
|
self.assertEqual(spec.report_key, "sentiment_report")
|