v0.49.1: image pickers see uppercase suffixes like IMG_1897.JPG

This commit is contained in:
2026-10-10 23:42:40 -07:00
parent 660740992a
commit 3dcd30eab6
6 changed files with 33 additions and 5 deletions
+10
View File
@@ -535,3 +535,13 @@ def test_several_images_land_in_order_with_a_gap(tmp_path):
assert page[spots[0]:spots[1]].count("<br><br>") == 1
assert (dest / "cover 2.png").read_bytes() == b"B"
assert not (dest / "placeholder.png").exists()
def test_image_filters_see_uppercase_suffixes():
"""Qt filters are case-sensitive on Linux; a phone's IMG_1897.JPG hid."""
import fnmatch
from lintunes.gui.file_filters import IMAGE_FILTER, WEB_IMAGE_FILTER
for flt in (IMAGE_FILTER, WEB_IMAGE_FILTER):
patterns = flt[flt.index("(") + 1:-1].split()
for name in ("IMG_1897.JPG", "a.jpeg", "b.PNG", "c.WebP"[:-4] + "WEBP"):
assert any(fnmatch.fnmatchcase(name, p) for p in patterns), name