Add download retry logic tests (12 tests, all passing)

 COMPLETE: 12/12 tests passing

Test Coverage:
- Automatic retry: Single item retry, retry all failed items
- Retry count tracking: Count increments on retry, persists across retries
- Maximum retry limit: Items not retried after max, mixed eligibility, configurable max_retries
- Retry state management: Error cleared, progress cleared, status updated, selective retry by IDs
- Exponential backoff: ImageDownloader implements exponential backoff (0.1s→0.2s delays)

All download retry mechanisms validated with proper state management and limit enforcement.
This commit is contained in:
2026-02-01 11:28:39 +01:00
parent 700415af57
commit 9157c4b274
2 changed files with 501 additions and 7 deletions

View File

@@ -558,13 +558,21 @@ All TIER 2 high priority core UX features have been completed:
- Test ✅ AnimeService ignores concurrent requests
- Target achieved: ✅ COMPLETE - all concurrent operation scenarios covered
- [ ] **Create tests/unit/test_download_retry.py** - Download retry logic tests
- Test automatic retry after download failure
- Test retry attempt count tracking
- Test exponential backoff between retries
- Test maximum retry limit enforcement
- Test retry state persistence
- Target: 80%+ coverage of retry logic in download service
- [x] **Create tests/unit/test_download_retry.py** - Download retry logic tests ✅ COMPLETE
- Note: 12/12 tests passing - comprehensive download retry coverage
- Coverage: Automatic retry (2 tests), retry count tracking (2 tests), maximum retry limit (3 tests), retry state management (4 tests), exponential backoff (1 test)
- Test ✅ Automatic retry after failure
- Test ✅ Retry all failed items
- Test ✅ Retry count increments
- Test ✅ Max retries enforced (items not retried after limit)
- Test ✅ Mixed eligibility (some at max, some eligible)
- Test ✅ Configurable max_retries parameter
- Test ✅ Error cleared on retry
- Test ✅ Progress cleared on retry
- Test ✅ Status updated (FAILED → PENDING)
- Test ✅ Selective retry by IDs
- Test ✅ Exponential backoff in ImageDownloader
- Target achieved: ✅ COMPLETE - excellent retry logic coverage
- [ ] **Create tests/integration/test_series_parsing_edge_cases.py** - Series parsing edge cases
- Test series folder names with year variations (e.g., "Series (2020)", "Series [2020]")