booru-viewer/tests/core
pax cf8bc0ad89 library_save: require category_fetcher to prevent silent category drop
behavior change: save_post_file's category_fetcher argument is now
keyword-only with no default, so every call site has to pass something
explicit (fetcher instance or None). Previously the =None default let
bookmark→library save and bookmark Save As slip through without a
fetcher at all, silently rendering %artist%/%character% tokens as
empty strings and producing filenames like '_12345.jpg' instead of
'greatartist_12345.jpg'.

BookmarksView now takes a category_fetcher_factory callable in its
constructor (wired to BooruApp._get_category_fetcher), called at save
time so it picks up the fetcher for whatever site is currently active.

tests/core/test_library_save.py pins the signature shape and the
three relevant paths: fetcher populates empty categories, None
accepted when categories are pre-populated (Danbooru/e621 inline),
fetcher skipped when template has no category tokens.
2026-04-15 17:32:25 -05:00
..
api category_fetcher: stop flipping _batch_api_works=False on transient errors in single-post path 2026-04-15 17:29:01 -05:00
__init__.py ship tests/ (81 tests, was gitignored) 2026-04-09 23:55:38 -05:00
test_cache.py security: fix #10 — validate media magic in first 16 bytes of stream 2026-04-11 16:24:59 -05:00
test_concurrency.py ship tests/ (81 tests, was gitignored) 2026-04-09 23:55:38 -05:00
test_config.py security: fix #7 — reject Windows reserved device names in template 2026-04-11 16:20:27 -05:00
test_db.py security: fix #4 — chmod SQLite DB + WAL/SHM sidecars to 0o600 2026-04-11 16:15:41 -05:00
test_library_save.py library_save: require category_fetcher to prevent silent category drop 2026-04-15 17:32:25 -05:00
test_pil_safety.py test_pil_safety: target core.config instead of core.images 2026-04-11 17:28:47 -05:00