tangled
alpha
login
or
join now
nandi.latha.org
/
pixi-skills
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
fix pre-commit
Pavel Zwerschke
1 month ago
5989b3c3
1ffac004
+21
-8
3 changed files
expand all
collapse all
unified
split
tests
test_backend.py
test_cli.py
test_skill.py
+9
-3
tests/test_backend.py
···
54
54
],
55
55
)
56
56
class TestGetSkillsDir:
57
57
-
def test_local(self, backend_cls: type[Backend], local_dir: str, global_suffix: str) -> None:
57
57
+
def test_local(
58
58
+
self, backend_cls: type[Backend], local_dir: str, global_suffix: str
59
59
+
) -> None:
58
60
backend = backend_cls()
59
61
assert backend.get_skills_dir(Scope.LOCAL) == Path(local_dir)
60
62
61
61
-
def test_global(self, backend_cls: type[Backend], local_dir: str, global_suffix: str) -> None:
63
63
+
def test_global(
64
64
+
self, backend_cls: type[Backend], local_dir: str, global_suffix: str
65
65
+
) -> None:
62
66
backend = backend_cls()
63
67
assert backend.get_skills_dir(Scope.GLOBAL) == Path.home() / global_suffix
64
68
···
98
102
second = backend.install(skill)
99
103
assert first == second
100
104
101
101
-
def test_install_replaces_different_symlink(self, setup: SetupFixture, tmp_path: Path) -> None:
105
105
+
def test_install_replaces_different_symlink(
106
106
+
self, setup: SetupFixture, tmp_path: Path
107
107
+
) -> None:
102
108
backend, skill, install_dir = setup
103
109
install_dir.mkdir(parents=True, exist_ok=True)
104
110
# Point at a real but different directory so .exists() returns True
+12
-4
tests/test_cli.py
···
21
21
22
22
23
23
class TestList:
24
24
-
def test_list_no_skills(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
24
24
+
def test_list_no_skills(
25
25
+
self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
26
26
+
) -> None:
25
27
monkeypatch.chdir(tmp_path)
26
28
monkeypatch.setattr(Path, "home", lambda: tmp_path)
27
29
result = runner.invoke(app, ["list"])
28
30
assert result.exit_code == 0
29
31
assert "no local skills found" in result.output.lower()
30
32
31
31
-
def test_list_local_only(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
33
33
+
def test_list_local_only(
34
34
+
self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
35
35
+
) -> None:
32
36
skill_dir = tmp_path / ".pixi/envs/default/share/agent-skills/test-skill"
33
37
skill_dir.mkdir(parents=True)
34
38
(skill_dir / "SKILL.md").write_text("---\ndescription: A test\n---\nBody\n")
···
39
43
assert result.exit_code == 0
40
44
assert "test-skill" in result.output
41
45
42
42
-
def test_list_global_scope(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
46
46
+
def test_list_global_scope(
47
47
+
self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
48
48
+
) -> None:
43
49
monkeypatch.chdir(tmp_path)
44
50
monkeypatch.setattr(Path, "home", lambda: tmp_path)
45
51
result = runner.invoke(app, ["list", "--scope", "global"])
···
52
58
result = runner.invoke(app, ["list", "--scope", "global", "--env", "custom"])
53
59
assert result.exit_code == 1
54
60
55
55
-
def test_list_custom_env(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
61
61
+
def test_list_custom_env(
62
62
+
self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
63
63
+
) -> None:
56
64
skill_dir = tmp_path / ".pixi/envs/myenv/share/agent-skills/env-skill"
57
65
skill_dir.mkdir(parents=True)
58
66
(skill_dir / "SKILL.md").write_text("---\ndescription: env\n---\nBody\n")
-1
tests/test_skill.py
···
11
11
parse_skill_md,
12
12
)
13
13
14
14
-
15
14
# --- Scope ordering ---
16
15
17
16