Wire the 4 B0 assets into combined_book_forward_job and a ScheduleDefinition (cron 30 23 * * *, UTC) via a Dagster Definitions object; dagster definitions validate passes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
21 lines
1.0 KiB
Python
21 lines
1.0 KiB
Python
"""The Definitions load and expose a daily schedule over the combined-book asset job + the 4 assets."""
|
|
from __future__ import annotations
|
|
|
|
|
|
def test_definitions_load_with_assets_and_schedule() -> None:
|
|
from fxhnt.adapters.orchestration.definitions import defs
|
|
|
|
# --- assets present ---
|
|
# defs.get_repository_def() is available in Dagster 1.12; its .assets_defs_by_key
|
|
# maps AssetKey → AssetsDefinition for every registered asset.
|
|
repo = defs.get_repository_def()
|
|
asset_keys = {k.to_user_string() for k in repo.assets_defs_by_key}
|
|
assert {"crypto_bars", "futures_bars", "combined_forward_nav", "cockpit_forward"} <= asset_keys
|
|
|
|
# --- schedule present with the right cron ---
|
|
# defs.schedules is a list[ScheduleDefinition] (or None when empty)
|
|
scheds = list(defs.schedules or [])
|
|
assert any(getattr(s, "cron_schedule", "") == "30 23 * * *" for s in scheds), (
|
|
f"expected a schedule with cron '30 23 * * *'; got {[getattr(s, 'cron_schedule', None) for s in scheds]}"
|
|
)
|