c85c0068a2
- Replace all datetime.utcnow() with datetime.now(tz=timezone.utc) across 8 files - Fix 12 failing tests to match current implementation behavior - Fix pytest_plugins in non-top-level conftest (moved to root conftest.py) - Auto-fix 189 lint issues (import sorting, unused imports) - Add CI/CD pipeline infrastructure (ARC, ArgoCD, Kargo manifests) - Add values-beta.yaml and values-paper.yaml for staged deployments - Update GitHub Actions workflow to use self-hosted-gremlin runners - Add integration-test job to CI pipeline Result: 1596 passed, 0 failed, 0 warnings
32 lines
790 B
Python
32 lines
790 B
Python
"""Basic tests for Redis key conventions."""
|
|
from services.shared.redis_keys import (
|
|
QUEUE_INGESTION,
|
|
QUEUE_PARSING,
|
|
cache_key,
|
|
dedupe_key,
|
|
lock_key,
|
|
queue_key,
|
|
rate_limit_key,
|
|
)
|
|
|
|
|
|
def test_lock_key_format():
|
|
assert lock_key("scheduler") == "stonks:lock:scheduler"
|
|
|
|
|
|
def test_rate_limit_key_format():
|
|
assert rate_limit_key("news_api", "202604111200") == "stonks:ratelimit:news_api:202604111200"
|
|
|
|
|
|
def test_queue_key_format():
|
|
assert queue_key(QUEUE_INGESTION) == "stonks:queue:ingestion"
|
|
assert queue_key(QUEUE_PARSING) == "stonks:queue:parsing"
|
|
|
|
|
|
def test_dedupe_key_format():
|
|
assert dedupe_key("abc123").startswith("stonks:dedupe:")
|
|
|
|
|
|
def test_cache_key_format():
|
|
assert cache_key("companies", "AAPL") == "stonks:cache:companies:AAPL"
|