This commit is contained in:
2026-05-31 23:30:35 -07:00
parent 431ffdff06
commit 3e50191530
20 changed files with 539 additions and 78 deletions
+22
View File
@@ -0,0 +1,22 @@
from pathlib import Path
from unittest.mock import patch
from evanescere.services.thumbnail import select_character_overlay
def test_select_character_overlay_returns_none_for_empty_directory(tmp_path: Path):
assert select_character_overlay(str(tmp_path)) is None
def test_select_character_overlay_filters_png_files(tmp_path: Path):
first = tmp_path / "first.PNG"
second = tmp_path / "second.png"
first.write_bytes(b"")
second.write_bytes(b"")
(tmp_path / "notes.txt").write_text("ignore me")
with patch("evanescere.services.thumbnail.random.choice", return_value=second) as choice:
assert select_character_overlay(str(tmp_path)) == second
assert choice.call_args.args[0] == [first, second]