-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_cli.py
More file actions
43 lines (30 loc) · 1.18 KB
/
Copy pathtest_cli.py
File metadata and controls
43 lines (30 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""Tests for CLI commands."""
from typer.testing import CliRunner
from archon.cli import app
runner = CliRunner()
def test_validate(sample_yaml):
result = runner.invoke(app, ["validate", sample_yaml])
assert result.exit_code == 0
assert "test_project" in result.output
assert "Spec is valid" in result.output
def test_compile(sample_yaml):
result = runner.invoke(app, ["compile-spec", sample_yaml])
assert result.exit_code == 0
assert "guardrail" in result.output.lower()
def test_generate(sample_yaml, tmp_path):
out = str(tmp_path / "gen")
result = runner.invoke(app, ["generate", sample_yaml, "-o", out])
assert result.exit_code == 0
assert "Generated" in result.output
def test_catalog():
result = runner.invoke(app, ["catalog"])
assert result.exit_code == 0
assert "Archon Pattern Catalog" in result.output
# Verify at least one entry from each domain is present
assert "text" in result.output
assert "tabular" in result.output
assert "image" in result.output
def test_run(sample_yaml):
result = runner.invoke(app, ["run", sample_yaml])
assert result.exit_code == 0
assert "Run complete" in result.output