test_news_client.py 463 B

123456789101112
  1. from __future__ import annotations
  2. def test_news_get_sentiment_shape():
  3. from src.trader_mcp.news_client import call_news_tool
  4. resp = call_news_tool("get_news_sentiment", {"entity": "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))