Commit Graph

5 Commits

Author SHA1 Message Date
2486449300 refactor(tests): remove noqa comments from test files
- Fix lint issues in keyboard_coop, lichess_bot, and tag_divider tests
- Prefix unused parameters with underscore instead of noqa: ARG002
2026-03-13 20:49:25 +01:00
a105a9d1ab refactor(keyboard_coop): remove dead/unreachable code
- Remove unreachable force-submit check (line 351): available_letters
  always contains the clicked letter after add(letter)
- Remove unreachable hover color branch (lines 398-404): the available
  check at line 396 catches all available letters first
- Remove unused KEY_HOVER_COLOR constant
- Remove unused mouse_pos variable in _draw_keyboard
- Update test from hover to unavailable key color test

Coverage: 97% -> 100%
2025-12-01 20:15:40 +01:00
b189829b48 feat(tests): improve keyboard_coop test coverage to 97%
- Add test for JSONDecodeError fallback dictionary loading
- Add test for game initialization (__init__)
- Add tests for handle_click on letter, enter button, and reset button
- Add tests for drawing methods (_draw_text_line, _draw_button, _draw_keyboard, _draw_ui)
- Add extensive tests for game loop (run) covering:
  - QUIT event handling
  - Mouse click events
  - ENTER key submission
  - R key reset
  - Letter key presses
  - Right click ignored
  - Special key ignored
  - Unknown event type ignored

Coverage improved from 58% to 97%. Remaining uncovered lines are:
- Line 351: Unreachable defensive code (force submit when no moves)
- Lines 398-404: Unreachable dead code (hover color branch)
2025-12-01 20:10:41 +01:00
c8162ba485 Improve test coverage for multiple modules
- scrape_website: 98% -> 100% (test download returning false)
- tag_divider: 44% -> 100% (test folder creation, image processing)
- extract_links: 61% -> 100% (test main() function directly)
- keyboard_coop: 22% -> 58% (test game logic methods)
2025-12-01 19:59:11 +01:00
bb7b8d5e02 Add tests for multiple python_pkg modules
- download_cats: Test generate_cats functionality (100% coverage)
- keyboard_coop: Test keyboard_listener with mocked pynput (22% coverage)
- mock_server: Test mitmproxy request interceptor (100% coverage)
- random_jpg: Test JPEG generation with mocked Pillow (100% coverage)
- randomize_numbers: Test random_digits functions (99% coverage)
- scrape_website: Test scrape_comics with mocked requests (98% coverage)
- split: Test text splitting utilities (100% coverage)
- tag_divider: Test tag_divider with mock filesystem (44% coverage)
- extract_links: Add HTML fixture for tests
2025-12-01 19:49:44 +01:00