Files
FESADev/tests/test_execute.py
T
2026-08-09 01:37:24 +09:00

37 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import json
import subprocess
from scripts import execute
def test_invoke_codex_uses_utf8_for_unicode_prompt(tmp_path, monkeypatch):
phase_dir = tmp_path / "phases" / "unicode-phase"
phase_dir.mkdir(parents=True)
(phase_dir / "index.json").write_text(
json.dumps(
{
"project": "FESA Structural Solver",
"phase": "unicode-phase",
"steps": [{"step": 0, "name": "unicode", "status": "pending"}],
}
),
encoding="utf-8",
)
(phase_dir / "step0.md").write_text("EulerBernoulli 보", encoding="utf-8")
invocation = {}
def capture_run(command, **kwargs):
invocation["command"] = command
invocation["kwargs"] = kwargs
return subprocess.CompletedProcess(command, 0, stdout="", stderr="")
monkeypatch.setattr(execute, "ROOT", tmp_path)
monkeypatch.setattr(execute.subprocess, "run", capture_run)
executor = execute.StepExecutor("unicode-phase")
executor._invoke_codex({"step": 0, "name": "unicode"}, "승인된 설계 ")
assert "EulerBernoulli 보" in invocation["kwargs"]["input"]
assert invocation["kwargs"]["encoding"] == "utf-8"