generated from coulomb/repo-seed
33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
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"]
|