Files
maigret/tests
e90ca42aac test: cover #2666 TODO-test paths (cookie_jar forwarding, extract_ids_from_results) (#2795)
Closes #2666.

Issue #2666 tracked four paths flagged `# TODO: tests`. Two of them
(`executors.py` increment_progress / stop_progress) were removed by the
#2789 refactor and no longer exist. This PR covers the two that remain:

1. maigret/checking.py:247 — the ClientSession cookie_jar forwarding.
   SimpleAiohttpChecker.check() builds ClientSession(cookie_jar=self.cookie_jar
   if self.cookie_jar else None), but nothing asserted the jar handed to the
   checker actually reached the outgoing session. Added two tests using the
   existing constructor-capture pattern (_capture_clientsession): one asserts
   a configured jar is forwarded verbatim, the other asserts None is passed
   when no jar is configured (the else branch).

2. maigret/maigret.py:946 — extract_ids_from_results. The pre-existing
   test_extract_ids_from_results was a bare expression with no `assert` (so
   it silently passed regardless of return value) AND pinned its expectation
   against test_db (tests/db.json), whose site set never matched the Reddit
   URL and silently dropped the ids_links result. Fixed: real assertion against
   default_db, plus three branch tests (cross-site username merge, empty-site
   skip, empty input).

No new dependencies: aioresponses was suggested in the issue but is not in
the project — the existing monkeypatch capture pattern fits the codebase
better and adds zero deps.

Removed both `# TODO: tests` comments from the now-covered lines.

Co-authored-by: aznikline <aznikline@users.noreply.github.com>
2026-06-22 19:22:37 +02:00
..
2021-01-02 00:23:58 +03:00
2021-05-18 00:43:56 +03:00
2026-06-17 15:15:32 +02:00
2026-06-17 15:15:32 +02:00