"""Tests for market sentiment module.""" from shared.sentiment import SentimentData def test_sentiment_should_buy_default_no_data(): s = SentimentData() assert s.should_buy is True assert s.should_block is False def test_sentiment_should_buy_low_fear_greed(): s = SentimentData(fear_greed_value=15) assert s.should_buy is True def test_sentiment_should_not_buy_on_greed(): s = SentimentData(fear_greed_value=75) assert s.should_buy is False def test_sentiment_should_not_buy_negative_news(): s = SentimentData(news_sentiment=-0.4) assert s.should_buy is False def test_sentiment_should_buy_positive_news(): s = SentimentData(fear_greed_value=50, news_sentiment=0.3) assert s.should_buy is True def test_sentiment_should_block_extreme_greed(): s = SentimentData(fear_greed_value=85) assert s.should_block is True def test_sentiment_should_block_very_negative_news(): s = SentimentData(news_sentiment=-0.6) assert s.should_block is True def test_sentiment_no_block_on_neutral(): s = SentimentData(fear_greed_value=50, news_sentiment=0.0) assert s.should_block is False