[Phase 1] Task 9: Write tests for new architecture #15

Closed
opened 2026-04-02 18:32:16 +02:00 by shoko · 0 comments
Owner

Task 9: Write tests

Labels: phase-1, tests
Dependency: Tasks 5 (#9), 6 (#11), 7 (#13), 8 (#14)

Goal

Write comprehensive tests for the new architecture.

Tests to create

  1. tests/test_models.py

    • Test dataclass instantiation
    • Test field access and types
  2. tests/test_services.py

    • Test BountyService with mocked storage
    • Test BountyService with mocked storage
    • Test TrackingService with mocked storage
    • Test PermissionError on unauthorized edit/delete
    • Test ValueError on bounty not found
  3. tests/test_json_adapter.py

    • Test JsonFileGroupStorage with temp directory
    • Test JsonFilePersonalStorage with temp directory
    • Test JsonFileTrackingStorage with temp directory
    • Test atomic writes
    • Test missing files return empty data
  4. tests/test_cli.py

    • Test CLI argument parsing
    • Test CLI commands with mocked services

Fix existing tests

  • Fix tests/conftest.py to remove broken db import
  • Current tests/test_commands.py tests should continue to work

Acceptance Criteria

  • All new tests pass
  • Existing tests pass
  • pytest runs without errors
## Task 9: Write tests **Labels:** phase-1, tests **Dependency:** Tasks 5 (#9), 6 (#11), 7 (#13), 8 (#14) ### Goal Write comprehensive tests for the new architecture. ### Tests to create 1. tests/test_models.py - Test dataclass instantiation - Test field access and types 2. tests/test_services.py - Test BountyService with mocked storage - Test BountyService with mocked storage - Test TrackingService with mocked storage - Test PermissionError on unauthorized edit/delete - Test ValueError on bounty not found 3. tests/test_json_adapter.py - Test JsonFileGroupStorage with temp directory - Test JsonFilePersonalStorage with temp directory - Test JsonFileTrackingStorage with temp directory - Test atomic writes - Test missing files return empty data 4. tests/test_cli.py - Test CLI argument parsing - Test CLI commands with mocked services ### Fix existing tests - Fix tests/conftest.py to remove broken db import - Current tests/test_commands.py tests should continue to work ### Acceptance Criteria - All new tests pass - Existing tests pass - pytest runs without errors
shoko added the phase-1tests labels 2026-04-02 18:34:44 +02:00
shoko closed this issue 2026-04-03 21:10:27 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/jigaido#15