mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-15 00:29:52 +03:00
fix(cli): isolate management subprocess environments
This commit is contained in:
@@ -442,12 +442,15 @@ def test_run_argv_logs_command_exit_and_output(
|
||||
encoding: str,
|
||||
errors: str,
|
||||
timeout: int,
|
||||
env: dict[str, str],
|
||||
) -> subprocess.CompletedProcess[str]:
|
||||
assert capture_output is True
|
||||
assert text is True
|
||||
assert encoding == "utf-8"
|
||||
assert errors == "replace"
|
||||
assert timeout == 5
|
||||
assert "OPENAI_API_KEY" not in env
|
||||
assert env["PYTHONUNBUFFERED"] == "1"
|
||||
return subprocess.CompletedProcess(argv, 0, stdout="installed ok", stderr="")
|
||||
|
||||
monkeypatch.setattr(cli_service, "logger", _Logger())
|
||||
|
||||
Reference in New Issue
Block a user