Add timezone and duration-boundary tests for SQLite persistence
Débutant
enhancementhelp wantedgood first issue
2 ★
Poids du clone léger
Mise à jour
Description
## User problem
The database stores timezone-aware timestamps in UTC and clamps an end time that
would precede its period start. These guarantees protect activity durations,
but they are not covered directly by unit tests.
## Expected result
Add focused database tests that document UTC serialization and non-negative
duration behavior. Keep the database schema unchanged unless a test exposes a
small defect.
## Likely files
- `tests/test_database.py`
- `timetracker/database.py` only if justified by a failing test
## Acceptance criteria
- Verify that `to_utc()` rejects a naive `datetime`.
- Verify that a non-UTC aware timestamp is normalized to UTC.
- Verify that `to_storage()` emits a timezone-qualified value with millisecond
precision.
- Verify that updating a period with an end before its start stores a zero
duration and does not move the end before the start.
- Verify that the idle flag and Unicode application/title values survive a
database round trip.
- Use a temporary database and leave no generated `activity.db` in the repo.
## Test command
```powershell
python -m unittest tests.test_database -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