test_news_client.py 441 B

123456789101112
  1. from __future__ import annotations
  2. def test_news_get_xrp_sentiment_shape():
  3. from src.trader_mcp.news_client import get_news_sentiment
  4. resp = get_news_sentiment("XRP")
  5. assert isinstance(resp, dict)
  6. assert resp.get("entity") == "XRP"
  7. assert resp.get("sentiment") in {"positive", "neutral", "negative"}
  8. assert isinstance(resp.get("score"), (int, float))
  9. assert isinstance(resp.get("cluster_count"), (int, float))