41 lines
1.4 KiB
Python
41 lines
1.4 KiB
Python
"""Smoke tests for fin-hub model registration."""
|
|
|
|
from fin_hub.models import (
|
|
Budget,
|
|
BurnRate,
|
|
Commitment,
|
|
EngagementPrice,
|
|
RunwayProjection,
|
|
ServiceCost,
|
|
TokenSpend,
|
|
)
|
|
from hub_core.models.base import Base
|
|
|
|
|
|
def test_fin_models_register_on_metadata():
|
|
tables = {table.name for table in Base.metadata.sorted_tables}
|
|
assert "fin_budgets" in tables
|
|
assert "fin_commitments" in tables
|
|
assert "fin_burn_rates" in tables
|
|
assert "fin_runway_projections" in tables
|
|
assert "fin_token_spends" in tables
|
|
assert "fin_service_costs" in tables
|
|
assert "fin_engagement_prices" in tables
|
|
|
|
|
|
def test_model_classes_importable():
|
|
assert Budget.__tablename__ == "fin_budgets"
|
|
assert Commitment.__tablename__ == "fin_commitments"
|
|
assert BurnRate.__tablename__ == "fin_burn_rates"
|
|
assert RunwayProjection.__tablename__ == "fin_runway_projections"
|
|
assert TokenSpend.__tablename__ == "fin_token_spends"
|
|
assert ServiceCost.__tablename__ == "fin_service_costs"
|
|
assert EngagementPrice.__tablename__ == "fin_engagement_prices"
|
|
|
|
|
|
def test_service_cost_has_external_attribution_seam():
|
|
columns = ServiceCost.__table__.columns
|
|
assert columns["client_id"].nullable is True
|
|
assert columns["application_id"].nullable is True
|
|
assert columns["app_instance_id"].nullable is True
|
|
assert columns["cost_attribution_key"].nullable is True
|