Fix ani-cli version probe player mode

This commit is contained in:
Codex
2026-07-26 14:29:46 +02:00
parent 629cf8dcb6
commit 8c62060d4a
5 changed files with 30 additions and 3 deletions
+17
View File
@@ -3319,6 +3319,23 @@ class HandlerRouteTests(unittest.TestCase):
self.assertIn("anipy_cli_version", handler.json_payload)
self.assertIn("animdl_version", handler.json_payload)
def test_ani_cli_version_probe_uses_download_player(self):
http_handler.installed_ani_cli_version.cache_clear()
calls = []
def fake_run(command, **kwargs):
calls.append((command, kwargs))
return mock.Mock(stdout="ani-cli 4.9.0\n", stderr="")
try:
with mock.patch.object(http_handler.subprocess, "run", side_effect=fake_run):
self.assertEqual(http_handler.installed_ani_cli_version(), "ani-cli 4.9.0")
finally:
http_handler.installed_ani_cli_version.cache_clear()
self.assertEqual(calls[0][0], [http_handler.ANI_CLI, "--version"])
self.assertEqual(calls[0][1]["env"]["ANI_CLI_PLAYER"], "download")
def test_dependencies_route_reports_fallback_tool_status(self):
handler = DummyHandler("/api/dependencies")
APP.Handler.do_GET(handler)