Add comprehensive tests for screen_locker module (100% coverage)

- Add test_screen_lock.py with 65 tests covering:
  - ScreenLocker initialization (demo/production mode)
  - Workout data validation (running and strength)
  - Log file operations (reading/writing JSON)
  - UI state transitions and timer logic
  - ask_workout_type/running_details/strength_details methods
  - Error handling and TclError exceptions

- Add type annotation to workout_data in screen_lock.py

Coverage: 273 statements, 38 branches - 100%
This commit is contained in:
Krzysztof kuhy Rudnicki 2025-12-02 23:13:36 +01:00
parent 3f64e0f927
commit 790746476e
2 changed files with 1163 additions and 1 deletions

View File

@ -43,7 +43,7 @@ class ScreenLocker:
self.lockout_time = (
10 if demo_mode else 1800
) # 10 seconds for demo, 30 minutes for production
self.workout_data = {}
self.workout_data: dict[str, str] = {}
# Get total screen dimensions across all monitors
screen_width = self.root.winfo_screenwidth()

File diff suppressed because it is too large Load Diff