[claude] Add unit tests for src/config.py (#1172) #1175
Reference in New Issue
Block a user
Delete Branch ":claude/issue-1172"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #1172
What
Add
tests/unit/test_config.pywithpytestmark = pytest.mark.unitso tests are picked up bytox -e unit.Coverage
normalize_ollama_urlhelper (6 cases including edge cases)Settingsdefaults for all major fields (agent_name, models, URLs, flags, timeouts)normalized_ollama_urlpropertyValidationErrorpaths_compute_repo_rootauto-detectionmodel_post_initgitea_token file fallback logiccheck_ollama_model_available: OSError, not found, exact match, prefix matchget_effective_ollama_modelfallback chain walkingvalidate_startup: test-mode skip, dev warnings, productionsys.exitguards (missing secrets, CORS wildcard)APP_START_TIMEand module-levelsettingssingletonTest result
293 passed (118 new config tests + existing suite),
tox -e unitgreen.