mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-09-25 14:02:38 +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
30 lines
1013 B
Python
30 lines
1013 B
Python
import unittest
|
|
|
|
import pytest
|
|
|
|
from cli.prompts import normalize_ticker_symbol
|
|
from tradingagents.agents.context import build_instrument_context
|
|
|
|
|
|
@pytest.mark.unit
|
|
class TickerSymbolHandlingTests(unittest.TestCase):
|
|
def test_normalize_ticker_symbol_preserves_exchange_suffix(self):
|
|
self.assertEqual(normalize_ticker_symbol(" cnc.to "), "CNC.TO")
|
|
|
|
def test_build_instrument_context_mentions_exact_symbol(self):
|
|
context = build_instrument_context("7203.T")
|
|
self.assertIn("7203.T", context)
|
|
self.assertIn("exchange suffix", context)
|
|
|
|
def test_single_get_ticker_no_shadow(self):
|
|
# Regression: cli/main.py had a duplicate get_ticker with an empty
|
|
# questionary prompt (rendered as a bare "?") that shadowed the
|
|
# descriptive one in cli/prompts. Keep a single canonical definition.
|
|
import cli.main
|
|
import cli.prompts
|
|
self.assertIs(cli.main.get_ticker, cli.prompts.get_ticker)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|