Add Avisynth video encoding workflow

This commit is contained in:
ajp_anton
2026-07-21 00:41:00 +00:00
parent f50f465465
commit 49296d6f45
37 changed files with 9487 additions and 76 deletions
+39
View File
@@ -0,0 +1,39 @@
from __future__ import annotations
import subprocess
import unittest
from pathlib import Path
from unittest.mock import patch
from tools.exiftool import run_exiftool_command
class ExiftoolInvocationTests(unittest.TestCase):
def test_windows_uses_utf8_argument_file_for_unicode_paths(self) -> None:
captured: dict[str, object] = {}
def fake_run(command, **kwargs):
captured["command"] = command
argument_file = Path(kwargs["cwd"]) / command[-1]
captured["contents"] = argument_file.read_text(encoding="utf-8")
return subprocess.CompletedProcess(command, 0)
with (
patch("tools.exiftool._use_windows_argument_file", return_value=True),
patch("tools.exiftool.subprocess.run", side_effect=fake_run),
):
run_exiftool_command(
"exiftool.exe",
["-j", "C:\\Photos\\M\u00e4rchen.jpg"],
check=True,
)
self.assertEqual(
captured["command"],
["exiftool.exe", "-charset", "filename=UTF8", "-@", "arguments.txt"],
)
self.assertEqual(captured["contents"], "-j\nC:\\Photos\\M\u00e4rchen.jpg\n")
if __name__ == "__main__":
unittest.main()