End-to-end integration tests proving that rename_chapters() fires correctly through the full download pipeline for each format strategy, and is properly suppressed when disabled.
End-to-end behavior: Tests exercise the full download_book() → _download_mp3() → rename_chapters() path using mock HTTP transports (existing pattern from TestFormatStrategy in test_downloader.py). Each test sets up a mock manifest with tracks, a mock ZIP part containing MP3 files, calls download_book(), and asserts on the resulting filenames in the output directory.
Test scenarios:
mp3_only + rename enabled → MP3s extracted AND renamed to chapter titles
m4b_mp3_fallback + M4B success + rename enabled → M4B downloaded, rename NOT called
m4b_only + rename enabled → M4B downloaded, rename NOT called
mp3_only + --no-rename-chapters → MP3s extracted but NOT renamed (original names kept)
Verbose output includes rename log lines when rename fires
These tests use the existing mock transport / ZIP fixture patterns from TestFormatStrategy (_make_mp3_zip(), custom transport with manifest responses).
Acceptance criteria
mp3_only + rename_chapters=True → extracted files have chapter-based names
m4b_mp3_fallback (M4B success) + rename_chapters=True → no rename side effects
m4b_only + rename_chapters=True → no rename side effects
mp3_only + rename_chapters=False → extracted files keep original names
Verbose mode logs rename operations
All new tests pass alongside existing ~374 tests
Blocked by
#34 (pipeline wiring must be complete before testing it)
## Parent
#19
## What to build
End-to-end integration tests proving that `rename_chapters()` fires correctly through the full download pipeline for each format strategy, and is properly suppressed when disabled.
**End-to-end behavior:** Tests exercise the full `download_book()` → `_download_mp3()` → `rename_chapters()` path using mock HTTP transports (existing pattern from `TestFormatStrategy` in test_downloader.py). Each test sets up a mock manifest with tracks, a mock ZIP part containing MP3 files, calls `download_book()`, and asserts on the resulting filenames in the output directory.
**Test scenarios:**
1. **mp3_only + rename enabled** → MP3s extracted AND renamed to chapter titles
2. **m4b_mp3_fallback + MP3 fallback + rename enabled** → MP3s extracted AND renamed
3. **m4b_mp3_fallback + M4B success + rename enabled** → M4B downloaded, rename NOT called
4. **m4b_only + rename enabled** → M4B downloaded, rename NOT called
5. **mp3_only + --no-rename-chapters** → MP3s extracted but NOT renamed (original names kept)
6. **Verbose output includes rename log lines** when rename fires
These tests use the existing mock transport / ZIP fixture patterns from `TestFormatStrategy` (`_make_mp3_zip()`, custom transport with manifest responses).
## Acceptance criteria
- [ ] mp3_only + rename_chapters=True → extracted files have chapter-based names
- [ ] m4b_mp3_fallback (MP3 fallback) + rename_chapters=True → extracted files have chapter-based names
- [ ] m4b_mp3_fallback (M4B success) + rename_chapters=True → no rename side effects
- [ ] m4b_only + rename_chapters=True → no rename side effects
- [ ] mp3_only + rename_chapters=False → extracted files keep original names
- [ ] Verbose mode logs rename operations
- [ ] All new tests pass alongside existing ~374 tests
## Blocked by
- #34 (pipeline wiring must be complete before testing it)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Parent
#19
What to build
End-to-end integration tests proving that
rename_chapters()fires correctly through the full download pipeline for each format strategy, and is properly suppressed when disabled.End-to-end behavior: Tests exercise the full
download_book()→_download_mp3()→rename_chapters()path using mock HTTP transports (existing pattern fromTestFormatStrategyin test_downloader.py). Each test sets up a mock manifest with tracks, a mock ZIP part containing MP3 files, callsdownload_book(), and asserts on the resulting filenames in the output directory.Test scenarios:
These tests use the existing mock transport / ZIP fixture patterns from
TestFormatStrategy(_make_mp3_zip(), custom transport with manifest responses).Acceptance criteria
Blocked by
✅ All 6/6 acceptance criteria met — 4 new integration tests added (1 missing AC#3 + 3 edge cases including 105-chapter 3-digit padding). ~233 tests pass.