❤️ TEST-#38: Add coverage for Sync and Restore single-mailbox paths - #82
Merged
Conversation
FernandoCelmer
commented
May 17, 2026
FernandoCelmer
left a comment
Member
Author
There was a problem hiding this comment.
🔍 Code Review
Code issues found: 0
Test-only PR. Two new modules close the biggest test-coverage gap in the library:
test_sync.py — covers insert, dedupe-on-second-pass, empty mailbox, progress callback invariant (ends at total), and the storage-error path that lands in result.errors.
test_restore.py — covers upload, server-side dedupe via _server_message_ids, missing-storage-entry drop, skip_duplicates=False force-upload, and _ensure_mailbox create/no-op branches.
Reusing make_fake_client keeps the suite hermetic — no new deps. Combined with #81 this fills the two open test-coverage tickets in one round.
Closes #38.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New test modules:
tests/clients/imap/test_sync.py— 5 tests forSync.sync:result.errorstests/clients/imap/test_restore.py— 7 tests forRestore.restore_mailbox+ helpers:_server_message_ids)APPENDskip_duplicates=Falseforces upload_ensure_mailbox: existing mailbox is no-op, missing mailbox is created_server_message_ids: empty SEARCH returns empty setTotal mocked IMAP scenarios use the existing
make_fake_clientfixture, so no new dependencies.Closes #38
Test plan
pytest tests/clients/imap/test_sync.py tests/clients/imap/test_restore.py— 12 passed