mantimon-tcg/backend/tests/services
Cal Corum 55e02ceb21 Replace silent error hiding with explicit failures
Three changes to fail fast instead of silently degrading:

1. GameService.create_game: Raise GameCreationError when energy card
   definition not found instead of logging warning and continuing.
   A deck with missing energy cards is fundamentally broken.

2. CardService.load_all: Collect all card file load failures and raise
   CardServiceLoadError at end with comprehensive error report. Prevents
   startup with partial card data that causes cryptic runtime errors.
   New exceptions: CardLoadError, CardServiceLoadError

3. GameStateManager.recover_active_games: Return RecoveryResult dataclass
   with recovered count, failed game IDs with error messages, and total.
   Enables proper monitoring and alerting for corrupted game state.

Tests added for energy card error case. Existing tests updated for
new RecoveryResult return type.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 18:48:06 -06:00
..
oauth Implement Phase 2: Authentication system 2026-01-27 21:49:59 -06:00
__init__.py Add GameStateManager service with Redis/Postgres dual storage 2026-01-27 10:59:58 -06:00
conftest.py Switch to testcontainers for automatic test container management 2026-01-28 16:49:11 -06:00
test_card_service.py Add CardService and card data conversion pipeline 2026-01-27 14:16:40 -06:00
test_collection_service.py Fix security and validation issues from code review 2026-01-28 14:16:07 -06:00
test_deck_service.py Fix medium priority issues from code review 2026-01-28 14:32:08 -06:00
test_game_state_manager.py Replace silent error hiding with explicit failures 2026-01-29 18:48:06 -06:00
test_jwt_service.py Implement Phase 2: Authentication system 2026-01-27 21:49:59 -06:00
test_user_service.py Fix OAuth absolute URLs and add account linking endpoints 2026-01-27 22:06:22 -06:00