Skip to content

Commit 6498c4e

Browse files
committed
add rich as runtime dependency and improve pytest coverage
1 parent 5afb439 commit 6498c4e

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

packages/agent-os/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ classifiers = [
4444
# Core dependencies (minimal - just what's needed for kernel)
4545
dependencies = [
4646
"pydantic>=2.4.0",
47+
"rich>=13.0.0"
4748
]
4849

4950
[project.urls]
Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
1-
# test_cli_run.py
2-
from agent_os.policies.cli import success, error, warn, policy_violation, passed_check
1+
from agent_os.policies.cli import success,error,warn,policy_violation,passed_check
32

4-
def main():
5-
print("=== Testing CLI functions with colored output ===\n")
6-
7-
print("1️⃣ success():")
3+
def test_success(capsys):
84
success("This is a success message")
5+
captured = capsys.readouterr()
6+
assert "success message" in captured.out.lower()
7+
98

10-
print("\n2️⃣ error():")
9+
def test_error(capsys):
1110
error("This is an error message")
11+
captured = capsys.readouterr()
12+
assert "error message" in captured.err.lower()
1213

13-
print("\n3️⃣ warn():")
14+
15+
def test_warn(capsys):
1416
warn("This is a warning message")
17+
captured = capsys.readouterr()
18+
assert "warning message" in captured.out.lower()
1519

16-
print("\n4️⃣ policy_violation():")
17-
policy_violation("Policy violation detected!")
1820

19-
print("\n5️⃣ passed_check():")
20-
passed_check("Test passed successfully!")
21+
def test_policy_violation(capsys):
22+
policy_violation("Policy violation detected!")
23+
captured = capsys.readouterr()
24+
assert "policy violation" in captured.out.lower()
2125

22-
print("\n=== Done testing CLI functions ===")
2326

24-
if __name__ == "__main__":
25-
main()
27+
def test_passed_check(capsys):
28+
passed_check("Test passed successfully!")
29+
captured = capsys.readouterr()
30+
assert "test passed" in captured.out.lower()

0 commit comments

Comments
 (0)