Files
stonks-oracle/tests/test_schemas.py
T
Celes Renata ebea70573b phase 0+1: project scaffold, k8s manifests, CI pipeline, steering, hooks, tests
- Repository structure for all services, infra, lakehouse, dashboards
- K8s manifests targeting stonks-oracle namespace with GHCR images
- Ingress via Traefik with ca-issuer TLS for internal services
- ConfigMap wired to existing cluster services (pg, redis, minio, ollama)
- GitHub Actions workflow for lint, test, multi-service container builds
- Dockerfile with build-arg CMD per service
- Makefile for local build/push/deploy
- Steering rules for TDD workflow, K8s conventions, project context
- Agent hooks for lint-on-save, test-on-save, k8s-validate, phase-commit
- Ruff linter config, all lint issues fixed
- 14 passing tests for schemas, config, redis keys
- PostgreSQL migrations, Trino catalogs, Superset config, MinIO lifecycle
2026-04-11 03:25:08 -07:00

51 lines
1.2 KiB
Python

"""Basic smoke tests for shared schemas."""
from services.shared.schemas import (
DocumentIntelligence,
TrendSummary,
Recommendation,
DocumentMetadata,
CompanyImpact,
Sentiment,
CatalystType,
ActionType,
)
def test_document_intelligence_defaults():
di = DocumentIntelligence()
assert di.document_id
assert di.confidence == 0.5
assert di.companies == []
def test_company_impact_validation():
ci = CompanyImpact(
ticker="AAPL",
company_name="Apple Inc.",
relevance=0.9,
sentiment=Sentiment.POSITIVE,
impact_score=0.7,
impact_horizon="1d_30d",
catalyst_type=CatalystType.EARNINGS,
)
assert ci.ticker == "AAPL"
assert ci.sentiment == Sentiment.POSITIVE
def test_trend_summary_defaults():
ts = TrendSummary()
assert ts.trend_strength == 0.5
assert ts.contradiction_score == 0.0
def test_recommendation_defaults():
rec = Recommendation()
assert rec.action == ActionType.WATCH
assert rec.position_sizing.portfolio_pct == 0.02
def test_document_metadata_defaults():
dm = DocumentMetadata()
assert dm.document_id
assert dm.language == "en"