Expand validation coverage for category configuration
Débutant
enhancementhelp wantedgood first issue
2 ★
Poids du clone léger
Mise à jour
Description
## User problem
`config.json` controls how private activity is categorized. The loader validates
many malformed inputs, but the test suite currently covers only a non-list
`categories` value. A future change could weaken validation and make the app
fail later with a confusing error.
## Expected result
Add focused, table-driven unit tests for the validation rules already provided
by `load_categorizer()`. Production code should change only if a test reveals a
small, clearly demonstrated defect.
## Likely files
- `tests/test_categories.py`
- `timetracker/categories.py` only when a failing test exposes a defect
## Acceptance criteria
- Cover invalid JSON and a configuration root that is not an object.
- Cover a missing or non-list `categories` field.
- Cover empty names, invalid `#RRGGBB` colors, and empty keyword lists.
- Cover non-string and whitespace-only keywords.
- Cover duplicate category names with different letter casing.
- Verify that valid names and keywords are trimmed.
- Use subtests or another compact pattern so failures identify the invalid case.
- Assert useful `CategoryConfigError` messages without depending on an entire
traceback.
## Test command
```powershell
python -m unittest tests.test_categories -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