Add report-period clipping tests at date-range boundaries
Débutant
enhancementhelp wantedgood first issue
2 ★
Poids du clone léger
Mise à jour
Description
## User problem
`collect_periods()` clips stored activity to the selected report range and
recomputes durations. This is essential for accurate daily totals, but the
current report tests construct already-clipped periods and do not exercise this
boundary logic.
## Expected result
Add focused tests using a temporary `ActivityDatabase` and `Categorizer` to
verify clipping at both ends of a range.
## Likely files
- `tests/test_reporting.py`
- `timetracker/reporting.py` only if a test reveals a defect
## Acceptance criteria
- Cover a period that begins before the selected range.
- Cover a period that ends after the selected range.
- Cover a period spanning the entire range.
- Verify recalculated start, end, and `duration_seconds` values.
- Verify that zero-length results are omitted.
- Verify active category assignment and the fixed Idle label/category behavior.
- Use timezone-aware datetimes and avoid assumptions that every local day is
exactly 24 hours.
## Test command
```powershell
python -m unittest tests.test_reporting -v
python -m unittest discover -v
```
Issues similaires
Tout voir
Python
Débutant
VS Code extension should be robust to YAML parser errors
Seeing this error: ``` Failed to read calkit.yaml: YAMLParseError: A block sequence may not be used as an im…
Mise à jour
Python
Débutant
dash: a manual Refresh control
The dashboard polls: `refreshStats()` (`src/doberman/dash/app.py:408`) every 5 s and `refreshPending()` (`:54…
Mise à jour
Python
Débutant
dash: "Copy details" button on each pending-approval card
Each pending-approval card in the dashboard (`renderPending`, `src/doberman/dash/app.py:448-544`) shows the r…
Mise à jour