Commit Graph

2 Commits

Author SHA1 Message Date
90c065eb1d Achieve 100% coverage for lichess_api.py
- Add test for spectator case (neither white nor black)
- Add test for non-gameFull events before gameFull
- Add test for stream ending without gameFull event
2025-12-01 20:46:09 +01:00
3ef256973f feat(tests): add comprehensive tests for lichess_bot engine and API
- Add test_engine.py with 100% coverage for engine.py
  - Tests for Engine class initialization
  - Tests for choose_move with various scenarios
  - Tests for best move parsing and validation
  - Tests for checkmate and stalemate detection

- Add test_lichess_api.py with 98% coverage for lichess_api.py
  - Tests for API initialization and request handling
  - Tests for stream_events with proper infinite loop handling
  - Tests for challenge accept/decline
  - Tests for game streaming and move submission
  - Tests for rate limit handling and retry logic

- Remove unreachable return statement in lichess_api.make_move

Coverage: engine.py 17% -> 100%, lichess_api.py 0% -> 98%
2025-12-01 20:41:51 +01:00