generated from coulomb/repo-seed
Add schedule smoke test routine
This commit is contained in:
32
tests/test_schedule_smoke_script.py
Normal file
32
tests/test_schedule_smoke_script.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _load_script():
|
||||
path = Path(__file__).parent.parent / "scripts" / "smoke_test_schedule.py"
|
||||
spec = importlib.util.spec_from_file_location("smoke_test_schedule", path)
|
||||
assert spec is not None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
assert spec.loader is not None
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
def test_schedule_smoke_script_dry_run_contract() -> None:
|
||||
script = _load_script()
|
||||
args = script.parse_args([
|
||||
"--activity-id",
|
||||
"00000000-0000-0000-0000-000000000123",
|
||||
"--recreate-recurring",
|
||||
"--dry-run",
|
||||
])
|
||||
|
||||
report = script.build_dry_run_report(args)
|
||||
|
||||
assert report["mode"] == "dry-run"
|
||||
assert report["activity_id"] == "00000000-0000-0000-0000-000000000123"
|
||||
assert report["recreate_recurring"] is True
|
||||
assert report["delay_seconds"] == 60
|
||||
assert "create a one-shot smoke Temporal Schedule one minute in the future" in report["checks"]
|
||||
Reference in New Issue
Block a user