File size: 1,518 Bytes
778278c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | from __future__ import annotations
import pytest
from hydradeck import cli
from hydradeck.core.types import RunConfig
def test_run_command_accepts_snapshot_total_timeout_default(
monkeypatch: pytest.MonkeyPatch,
) -> None:
captured: dict[str, float] = {}
def fake_run(cfg: RunConfig) -> object:
captured["snapshot_total_timeout_s"] = cfg.snapshot_total_timeout_s
return object()
monkeypatch.setattr(cli, "run", fake_run)
code = cli.main(
[
"run",
"--topic",
"t",
"--out",
"out.zip",
"--base-url",
"https://example.invalid",
"--model",
"mock",
"--mock",
]
)
assert code == 0
assert captured["snapshot_total_timeout_s"] == 60.0
def test_run_command_passes_request_budget(monkeypatch: pytest.MonkeyPatch) -> None:
captured: dict[str, float] = {}
def fake_run(cfg: RunConfig) -> object:
captured["request_budget_s"] = cfg.request_budget_s
return object()
monkeypatch.setattr(cli, "run", fake_run)
code = cli.main(
[
"run",
"--topic",
"t",
"--out",
"out.zip",
"--base-url",
"https://example.invalid",
"--model",
"mock",
"--request-budget",
"90",
"--mock",
]
)
assert code == 0
assert captured["request_budget_s"] == 90.0
|