Complete Phase 7: Testing and Validation for identifier standardization

- Task 7.1: Update All Test Fixtures to Use Key
  - Updated FakeSerie/FakeSeriesApp with realistic keys in test_anime_endpoints.py
  - Updated 6+ fixtures in test_websocket_integration.py
  - Updated 5 fixtures in test_download_progress_integration.py
  - Updated 9 fixtures in test_download_progress_websocket.py
  - Updated 10+ fixtures in test_download_models.py
  - All fixtures now use URL-safe, lowercase, hyphenated key format

- Task 7.2: Add Integration Tests for Identifier Consistency
  - Created tests/integration/test_identifier_consistency.py with 10 tests
  - TestAPIIdentifierConsistency: API response validation
  - TestServiceIdentifierConsistency: Download service key usage
  - TestWebSocketIdentifierConsistency: WebSocket events
  - TestIdentifierValidation: Model validation
  - TestEndToEndIdentifierFlow: Full flow verification
  - Tests use UUID suffixes for isolation

All 1006 tests passing.
This commit is contained in:
2025-11-28 17:41:54 +01:00
parent 0c8b296aa6
commit 6e9087d0f4
7 changed files with 680 additions and 87 deletions

View File

@@ -124,9 +124,10 @@ class TestDownloadProgressIntegration:
)
# Add download to queue
# Note: serie_id uses provider key format (URL-safe, lowercase)
await download_service.add_to_queue(
serie_id="integration_test",
serie_folder="test_folder",
serie_id="integration-test-key",
serie_folder="Integration Test Anime (2024)",
serie_name="Integration Test Anime",
episodes=[EpisodeIdentifier(season=1, episode=1)],
)
@@ -197,9 +198,10 @@ class TestDownloadProgressIntegration:
)
# Add and start download
# Note: serie_id uses provider key format (URL-safe, lowercase)
await download_service.add_to_queue(
serie_id="client_test",
serie_folder="test_folder",
serie_id="client-test-key",
serie_folder="Client Test Anime (2024)",
serie_name="Client Test Anime",
episodes=[EpisodeIdentifier(season=1, episode=1)],
)
@@ -273,9 +275,10 @@ class TestDownloadProgressIntegration:
)
# Start download
# Note: serie_id uses provider key format (URL-safe, lowercase)
await download_service.add_to_queue(
serie_id="multi_client_test",
serie_folder="test_folder",
serie_id="multi-client-test-key",
serie_folder="Multi Client Test (2024)",
serie_name="Multi Client Test",
episodes=[EpisodeIdentifier(season=1, episode=1)],
)
@@ -320,9 +323,10 @@ class TestDownloadProgressIntegration:
progress_service.subscribe("progress_updated", capture_broadcast)
# Note: serie_id uses provider key format (URL-safe, lowercase)
await download_service.add_to_queue(
serie_id="structure_test",
serie_folder="test_folder",
serie_id="structure-test-key",
serie_folder="Structure Test (2024)",
serie_name="Structure Test",
episodes=[EpisodeIdentifier(season=2, episode=3)],
)
@@ -382,9 +386,10 @@ class TestDownloadProgressIntegration:
)
# Start download after disconnect
# Note: serie_id uses provider key format (URL-safe, lowercase)
await download_service.add_to_queue(
serie_id="disconnect_test",
serie_folder="test_folder",
serie_id="disconnect-test-key",
serie_folder="Disconnect Test (2024)",
serie_name="Disconnect Test",
episodes=[EpisodeIdentifier(season=1, episode=1)],
)