various fix
This commit is contained in:
@@ -266,6 +266,32 @@ def test_build_visualization_command_uses_hand_model_and_result_tsv(
|
||||
assert cmd[cmd.index("--max-width") + 1] == str(VISUALIZATION_MAX_WIDTH)
|
||||
|
||||
|
||||
def test_build_visualization_command_passes_font_path_when_available(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
bundle = tmp_path / "bundle"
|
||||
write_minimal_reference_bundle(bundle)
|
||||
(bundle / "weights").mkdir()
|
||||
(bundle / "weights" / "hand_detect.pt").write_bytes(b"fake")
|
||||
(bundle / "visualize_result_video.py").write_text("# fake\n", encoding="utf-8")
|
||||
font = tmp_path / "NotoSansCJK-Regular.ttc"
|
||||
font.write_bytes(b"fake-font")
|
||||
monkeypatch.setattr(
|
||||
"app.algo_host.subprocess_runner.resolve_cjk_font_path",
|
||||
lambda: font,
|
||||
)
|
||||
|
||||
cmd = build_visualization_command(
|
||||
bundle_dir=bundle,
|
||||
video_path=tmp_path / "input.mp4",
|
||||
result_path=tmp_path / "result.tsv",
|
||||
output_video_path=tmp_path / "result_vis.mp4",
|
||||
)
|
||||
|
||||
assert cmd[cmd.index("--font-path") + 1] == str(font)
|
||||
|
||||
|
||||
def test_build_batch_main_command_uses_5_15_main_py(tmp_path: Path) -> None:
|
||||
cmd = build_batch_main_command(
|
||||
bundle_dir=tmp_path / "algorithm_subprocesses" / "5.15",
|
||||
|
||||
Reference in New Issue
Block a user