mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-09-19 11:15:24 +03:00
fix(dataflows): map crypto to StockTwits/Reddit sentiment symbols
- crypto reached StockTwits as Yahoo's BTC-USD (404) instead of BTC.X, and Reddit searched the dashed pair that barely matches; both now resolve the base via a shared crypto_base() helper, restoring crypto sentiment - also fixes a StockTwits resilience test class that pytest never collected #1113
This commit is contained in:
@@ -190,3 +190,25 @@ class TestFormatterHandlesRssPosts:
|
||||
assert "1234↑" in out
|
||||
assert "56c" in out
|
||||
assert "via RSS" not in out
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
class TestCryptoSearchTerm:
|
||||
"""A crypto pair (BTC-USD) barely matches Reddit text; search the base (#1113)."""
|
||||
|
||||
def _captured_ticker(self, ticker):
|
||||
seen = {}
|
||||
|
||||
def fake_fetch(t, sub, limit, timeout):
|
||||
seen["ticker"] = t
|
||||
return []
|
||||
|
||||
with patch.object(reddit, "_fetch_subreddit", side_effect=fake_fetch):
|
||||
reddit.fetch_reddit_posts(ticker, subreddits=("stocks",), inter_request_delay=0)
|
||||
return seen["ticker"]
|
||||
|
||||
def test_crypto_pair_searches_base(self):
|
||||
assert self._captured_ticker("BTC-USD") == "BTC"
|
||||
|
||||
def test_equity_passes_through(self):
|
||||
assert self._captured_ticker("NVDA") == "NVDA"
|
||||
|
||||
Reference in New Issue
Block a user