v0.49.1: image pickers see uppercase suffixes like IMG_1897.JPG
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user