forked from microsoft/agent-governance-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_cli_output.py
More file actions
33 lines (23 loc) · 954 Bytes
/
test_cli_output.py
File metadata and controls
33 lines (23 loc) · 954 Bytes
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
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from agent_os.policies.cli import success,error,warn,policy_violation,passed_check
def test_success(capsys):
success("This is a success message")
captured = capsys.readouterr()
assert "success message" in captured.out.lower()
def test_error(capsys):
error("This is an error message")
captured = capsys.readouterr()
assert "error message" in captured.err.lower()
def test_warn(capsys):
warn("This is a warning message")
captured = capsys.readouterr()
assert "warning message" in captured.out.lower()
def test_policy_violation(capsys):
policy_violation("Policy violation detected!")
captured = capsys.readouterr()
assert "policy violation" in captured.out.lower()
def test_passed_check(capsys):
passed_check("Test passed successfully!")
captured = capsys.readouterr()
assert "test passed" in captured.out.lower()