feat: improve CLI UTF-8 support and enhance JSON output validation in bridge.py

This commit is contained in:
catlog22
2026-03-17 15:30:16 +08:00
parent 0f02b75be1
commit 34749d2fad
3 changed files with 25 additions and 16 deletions

View File

@@ -91,7 +91,8 @@ class TestJsonHelpers:
def test_json_output_unicode(self, capsys):
_json_output({"msg": "中文测试"})
out = capsys.readouterr().out.strip()
assert "中文测试" in out
parsed = json.loads(out)
assert parsed["msg"] == "中文测试"
def test_error_exit(self):
with pytest.raises(SystemExit) as exc_info: