feat: add Meet Kevin SQLAlchemy models (5 tables)
This commit is contained in:
parent
8a412e6ae9
commit
8ed2e70e8f
3 changed files with 297 additions and 0 deletions
|
|
@ -351,6 +351,11 @@ class TestMetadata:
|
|||
"portfolio_snapshots",
|
||||
"strategy_metrics",
|
||||
"fundamentals",
|
||||
"kevin_channels",
|
||||
"kevin_videos",
|
||||
"kevin_transcripts",
|
||||
"kevin_analyses",
|
||||
"kevin_stock_mentions",
|
||||
}
|
||||
assert expected.issubset(table_names)
|
||||
|
||||
|
|
@ -360,6 +365,37 @@ class TestMetadata:
|
|||
assert "updated_at" in Strategy.__table__.columns
|
||||
|
||||
|
||||
class TestMeetKevinModels:
|
||||
def test_meet_kevin_models_importable(self) -> None:
|
||||
"""Test that Meet Kevin models are importable and have correct table names and enums."""
|
||||
from shared.models import (
|
||||
KevinChannel,
|
||||
KevinVideo,
|
||||
KevinTranscript,
|
||||
KevinAnalysis,
|
||||
KevinStockMention,
|
||||
)
|
||||
|
||||
# Check table names
|
||||
assert KevinChannel.__tablename__ == "kevin_channels"
|
||||
assert KevinVideo.__tablename__ == "kevin_videos"
|
||||
assert KevinTranscript.__tablename__ == "kevin_transcripts"
|
||||
assert KevinAnalysis.__tablename__ == "kevin_analyses"
|
||||
assert KevinStockMention.__tablename__ == "kevin_stock_mentions"
|
||||
|
||||
# Check that KevinVideo.status is an Enum containing "DISCOVERED"
|
||||
status_col = KevinVideo.__table__.c.status
|
||||
assert status_col is not None
|
||||
assert "DISCOVERED" in status_col.type.enums
|
||||
|
||||
# Check relationships exist
|
||||
assert hasattr(KevinChannel, "videos")
|
||||
assert hasattr(KevinVideo, "channel")
|
||||
assert hasattr(KevinVideo, "transcript")
|
||||
assert hasattr(KevinVideo, "analyses")
|
||||
assert hasattr(KevinVideo, "mentions")
|
||||
|
||||
|
||||
class TestDbFactory:
|
||||
def test_create_db_returns_engine_and_session(self) -> None:
|
||||
config = BaseConfig()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue