tmux-amq/tests/test_policy.py

15 lines
508 B
Python
Raw Normal View History

from tamq.policy import load_profile
def test_default_policy(tmp_path):
profile = load_profile(tmp_path / "missing.toml")
assert profile.name == "default"
assert "secrets" in profile.require_human
def test_configured_policy(tmp_path):
path = tmp_path / "config.toml"
path.write_text("[policy.profiles.dev]\nallow=['repo_inspect']\nrequire_human=['destructive']\nsafety_gated_max_attempts=2\n")
profile = load_profile(path, "dev")
assert profile.safety_gated_max_attempts == 2