summaryrefslogtreecommitdiff
path: root/shared/tests/test_sa_news_models.py
blob: 91e6d4a4e1a4d1ccd8a34f567ff57dec627370f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Tests for news-related SQLAlchemy models."""

from shared.sa_models import NewsItemRow, SymbolScoreRow, MarketSentimentRow, StockSelectionRow


def test_news_item_row_tablename():
    assert NewsItemRow.__tablename__ == "news_items"


def test_symbol_score_row_tablename():
    assert SymbolScoreRow.__tablename__ == "symbol_scores"


def test_market_sentiment_row_tablename():
    assert MarketSentimentRow.__tablename__ == "market_sentiment"


def test_stock_selection_row_tablename():
    assert StockSelectionRow.__tablename__ == "stock_selections"


def test_news_item_row_columns():
    cols = {c.name for c in NewsItemRow.__table__.columns}
    assert cols >= {"id", "source", "headline", "published_at", "sentiment", "category"}


def test_symbol_score_row_columns():
    cols = {c.name for c in SymbolScoreRow.__table__.columns}
    assert cols >= {"id", "symbol", "news_score", "composite", "updated_at"}