Validate training completion handoff
This commit is contained in:
@@ -33,5 +33,17 @@ def test_container_running_fails_closed_on_inspect_error(monkeypatch) -> None:
|
||||
def test_completion_command_requires_non_empty_string_list(tmp_path: Path) -> None:
|
||||
invalid = tmp_path / "command.json"
|
||||
invalid.write_text('{"shell": "unsafe"}', encoding="utf-8")
|
||||
value = MODULE.json.loads(invalid.read_text(encoding="utf-8"))
|
||||
assert not isinstance(value, list)
|
||||
try:
|
||||
MODULE.load_completion_command(invalid)
|
||||
except ValueError as exc:
|
||||
assert "non-empty JSON list" in str(exc)
|
||||
else:
|
||||
raise AssertionError("mapping-shaped completion command was accepted")
|
||||
|
||||
|
||||
def test_completion_command_preserves_exact_argv_without_shell_parsing(tmp_path: Path) -> None:
|
||||
command = tmp_path / "command.json"
|
||||
command.write_text('["docker", "exec", "-d", "geointel", "python", "loop.py"]', encoding="utf-8")
|
||||
assert MODULE.load_completion_command(command) == [
|
||||
"docker", "exec", "-d", "geointel", "python", "loop.py"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user