diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-25 18:13:39 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-25 18:13:39 +0200 |
| commit | 88ac15f496cde6104709ec6925212df0eb3cddc2 (patch) | |
| tree | 8566472b03631edb58017f939923452a22c73bbe /test_llamachat.py | |
| parent | ea63943b0e9f755d00cf3e69b5ae5cebb41eb959 (diff) | |
| download | llamachat-88ac15f496cde6104709ec6925212df0eb3cddc2.tar.gz llamachat-88ac15f496cde6104709ec6925212df0eb3cddc2.zip | |
feat: skills config keys, on by default
Diffstat (limited to 'test_llamachat.py')
| -rwxr-xr-x | test_llamachat.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test_llamachat.py b/test_llamachat.py index ef73fe3..ed990af 100755 --- a/test_llamachat.py +++ b/test_llamachat.py @@ -1137,6 +1137,35 @@ def test_config_defaults(): print("ok config defaults") +def test_skills_config(): + with tempfile.TemporaryDirectory() as tmp: + skills_dir = Path(tmp) / "skills" + (skills_dir / "firefly-cli").mkdir(parents=True) + (skills_dir / "firefly-cli" / "SKILL.md").write_text( + "---\nname: firefly-cli\ndescription: d\n---\n\nbody\n" + ) + path = Path(tmp) / "config.toml" + path.write_text(f'skills_enabled = true\nskills_dir = "{skills_dir}"\n') + cfg = config.load(path) + assert cfg.skills_enabled is True + assert cfg.skills_dir == skills_dir + + # A flag whose directory does not exist resolves to off, mirroring + # the search rule that a flag with no URL stays off. + path.write_text('skills_enabled = true\nskills_dir = "/nonexistent"\n') + assert config.load(path).skills_enabled is False + + assert config.DEFAULTS["skills_enabled"] is True + assert config.DEFAULTS["skills_dir"] == "~/.agents/skills" + + with tempfile.TemporaryDirectory() as tmp: + written = config.write_default(Path(tmp) / "config.toml") + text = written.read_text() + assert "skills_enabled" in text + assert "skills_dir" in text + print("ok skills config") + + def test_provider_parsing(): """Providers come from [providers.*]; a bare base_url synthesizes local.""" from llamachat import providers @@ -3482,6 +3511,7 @@ if __name__ == "__main__": test_version_matches_changelog() test_venv_discovery() test_config_defaults() + test_skills_config() test_provider_parsing() test_provider_malformed_shapes() test_unusable_config_exits() |
