test(cli): verify layer selection reaches local and remote execution

This commit is contained in:
Joseph Magly
2026-09-07 16:20:38 -04:00
parent 5fe46d2dca
commit bbf06fd6c8
2 changed files with 34 additions and 5 deletions
+22
View File
@@ -123,3 +123,25 @@ def test_every_offered_strategy_is_one_distill_actually_dispatches_on():
assert branches | {"knee_cosmic"} == EXPECTED_CHOICES, (
f"_distill dispatches on {branches | {'knee_cosmic'}}, CLI offers {EXPECTED_CHOICES}"
)
@pytest.mark.parametrize("strategy", [None, "all", "middle60"])
def test_remote_cli_preserves_override_and_method_default(strategy, monkeypatch):
from unittest.mock import Mock
runner = Mock()
runner.run_obliterate.return_value = "result"
monkeypatch.setattr(cli, "_make_remote_runner", lambda args: runner)
argv = ["obliterate", "org/model", "--remote", "operator@example.invalid",
"--method", "optimized"]
if strategy is not None:
argv += ["--layer-selection", strategy]
cli.main(argv)
forwarded = runner.run_obliterate.call_args.kwargs
assert forwarded["method"] == "optimized"
if strategy is None:
assert "layer_selection" not in forwarded
else:
assert forwarded["layer_selection"] == strategy