test(cookbook): cover adopt remote host validation (#5225)

This commit is contained in:
RaresKeY
2026-07-18 13:07:48 +02:00
committed by GitHub
parent 09d4fec254
commit 6c4cb2485d
+3 -2
View File
@@ -199,7 +199,8 @@ async def test_documents_pagination_out_of_range_offset_returns_empty_page():
assert result["next_offset"] is None assert result["next_offset"] is None
def test_adopt_rejects_ssh_option_host_before_shell(monkeypatch): @pytest.mark.parametrize("host_field", ["host", "remote_host"])
def test_adopt_rejects_ssh_option_host_before_shell(monkeypatch, host_field):
calls = [] calls = []
async def fail_if_shell_runs(*args, **kwargs): async def fail_if_shell_runs(*args, **kwargs):
@@ -212,7 +213,7 @@ def test_adopt_rejects_ssh_option_host_before_shell(monkeypatch):
body = { body = {
"tmux_session": "serve_abc123", "tmux_session": "serve_abc123",
"model": "org/model", "model": "org/model",
"host": "-oProxyCommand=sh", host_field: "-oProxyCommand=sh",
} }
with pytest.raises(HTTPException) as exc: with pytest.raises(HTTPException) as exc: