mirror of
https://github.com/tvytlx/ai-agent-deep-dive.git
synced 2026-04-03 15:44:49 +08:00
Add teaching Python agent CLI with Poetry and CI
This commit is contained in:
30
tests/test_cli.py
Normal file
30
tests/test_cli.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from pathlib import Path
|
||||
from subprocess import run
|
||||
import sys
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def test_cli_lists_skills(tmp_path) -> None:
|
||||
skill_dir = tmp_path / "skills" / "analysis"
|
||||
skill_dir.mkdir(parents=True)
|
||||
(skill_dir / "SKILL.md").write_text("# analysis", encoding="utf-8")
|
||||
|
||||
result = run(
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"agt.cli",
|
||||
"--skills-dir",
|
||||
str(tmp_path / "skills"),
|
||||
"--list-skills",
|
||||
],
|
||||
cwd=ROOT,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
)
|
||||
|
||||
assert result.returncode == 0
|
||||
assert "analysis" in result.stdout
|
||||
Reference in New Issue
Block a user