Aller au contenu
login
arrow_backRetour aux issues
HafidIdrissi/Time-Tracker #21

Document and test half-open interval overlap queries

ecoDébutant enhancement help wanted good first issue

descriptionDescription

## User problem Reports rely on `periods_between()` returning periods that overlap the half-open interval `[range_start, range_end)`. Boundary mistakes could omit a real period or include activity from the next report day. ## Expected result Add a compact test matrix for the query's overlap and ordering semantics. Production behavior should change only if the matrix exposes a defect. ## Likely files - `tests/test_database.py` - `timetracker/database.py` only if a test reveals a bug ## Acceptance criteria - Include a period entirely before the range and verify it is excluded. - Include a period ending exactly at `range_start` and verify it is excluded. - Include periods crossing the start, inside the range, and crossing the end; verify all three are returned. - Include a period starting exactly at `range_end` and verify it is excluded. - Verify deterministic ordering by start time and then database ID. - Assert that the database method returns stored periods without clipping them; clipping remains the reporting layer's responsibility. ## Test command ```powershell python -m unittest tests.test_database -v python -m unittest discover -v ```
codeOuvre sur GitHub