fix: decode harness git output as utf-8

This commit is contained in:
KOKO\Mimi
2026-08-09 01:54:27 +09:00
parent 67ff700dfc
commit 8895adf24c
2 changed files with 29 additions and 2 deletions
+25
View File
@@ -34,3 +34,28 @@ def test_invoke_codex_uses_utf8_for_unicode_prompt(tmp_path, monkeypatch):
assert "EulerBernoulli 보" in invocation["kwargs"]["input"]
assert invocation["kwargs"]["encoding"] == "utf-8"
def test_run_git_decodes_output_as_utf8(tmp_path, monkeypatch):
invocation = {}
def capture_run(command, **kwargs):
invocation["command"] = command
invocation["kwargs"] = kwargs
return subprocess.CompletedProcess(command, 0, stdout="", stderr="")
monkeypatch.setattr(execute.subprocess, "run", capture_run)
executor = object.__new__(execute.StepExecutor)
executor._root = str(tmp_path)
executor._run_git("status", "--short")
assert invocation["kwargs"]["encoding"] == "utf-8"
def test_feature_commit_message_is_windows_console_safe():
message = execute.StepExecutor.FEAT_MSG.format(
phase="linear-static-3d-euler-beam", num=0, name="requirements-baseline"
)
message.encode("cp949")