wrolpi/modules/archive/test
lrnselfreliance 57c2a29022
domains.yaml imports by diffing (#871)
* domains.yaml imports by diffing

domains.yaml declares one section, its domain Collections keyed by name,
comparing description, directory, Tag and file format.  An unchanged
import writes nothing.

A removed domain without Archives is deleted; one with Archives is reset
to its default settings (decision 7c: a refresh of its Archives would
re-create it), and the config is saved with it.  An invalid entry (name
or directory) is skipped, counted, and its domain kept.  Once tags.yaml
is imported, a domain's Tag that no longer exists is dropped and the
config saved without it (`unknown_tag_names`).

Linking Downloads to domains reads first (the domains once, not one query
per RSS Download) and opens a short write only when there is something to
link; the config is then saved with the links.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test_bookmarks_config_import starts the app like its siblings

It imports a config without `async_client`, so it fails (no
shared_ctx.configs_imported) whenever it is the first test on its
worker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* domains.yaml: converge without a save; no links while entries are skipped

A save after the import is refused while an entry is skipped, so the
import must converge without one:
- a removed domain with Archives that is already reset is left as it is
  (prepare reads `import_db_rows`); before, every import reset it again;
- after prepare, the framework drops changed rows that now match the
  database (a dropped unknown Tag), so they are not written again.

Linking Downloads changes domains.yaml after its version is recorded;
while entries are skipped the save is refused, the database stays newer,
and the next startup would save over the skipped entries.  Linking now
waits for an import without skipped entries.

An entry that is not a mapping is skipped and counted, instead of failing
the whole file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 11:41:59 -06:00
..
__init__.py A new start 2021-11-01 16:43:09 -06:00
test_api.py Archive and doc pages record a view in its own write transaction (#813) 2026-10-11 14:13:50 -06:00
test_archive_downloader.py Single file deno (#478) 2026-06-12 17:07:28 -06:00
test_archive_modeler_loop.py Archives: an unpaired-surrogate title must not kill the modeler. 2026-07-13 19:25:30 -06:00
test_collection_id_bug.py Upgrade to SQLAlchemy 2.0 (synchronous) (#803) 2026-10-09 15:08:40 -06:00
test_compressed_singlefile.py HTML indexer is binary-safe; it indexes the page inside a compressed singlefile. 2026-06-12 17:24:02 -06:00
test_config_import_scenarios.py Detecting collection directories using collection formatting rather than relying on parent directory of file groups, because those are now longer always in the collection directory. 2026-02-07 17:16:08 -07:00
test_domain_tagging.py Fixing bug where configs could be overwritten with empty configs on first refresh. Fixing bug where configs were displayed as JSON in admin settings. 2026-03-22 12:56:37 -06:00
test_domains_config.py Database configs carry a version the database keeps too (#866) 2026-10-24 14:58:18 -06:00
test_domains_config_import.py domains.yaml imports by diffing (#871) 2026-10-25 11:41:59 -06:00
test_lib.py Apply the offset in a SingleFile saved date, and repair misread Archive dates (#862) 2026-10-23 14:34:29 -06:00
test_models.py Storing parent_download_url in a file group's json file after download has completed. 2026-03-03 15:54:22 -07:00