fix: validate project path key, avoid shared mutable default

This commit is contained in:
2026-04-04 14:19:32 +02:00
parent 10a05ba55a
commit b2f38f071d
2 changed files with 15 additions and 1 deletions
+12
View File
@@ -23,6 +23,18 @@ def test_missing_projects_raises():
load_config(name)
os.unlink(name)
def test_project_missing_path_raises():
data = {
'projects': [{'benchmarks': ['echo ok']}], # no 'path' key
'token_threshold': {'context_remaining_pct': 60, 'api_budget_usd': 5.0}
}
with tempfile.NamedTemporaryFile('w', suffix='.yaml', delete=False) as f:
yaml.dump(data, f)
name = f.name
with pytest.raises(ConfigError):
load_config(name)
os.unlink(name)
def test_expands_tilde_in_path():
data = {
'projects': [{'path': '~/.claude', 'benchmarks': [], 'time_limit_minutes': 5}],