Files
OpenJarvis/tests/security/test_severity_policy.py
T
Prathap PandGitHub c2756964a7 fix(channels): wire channel→agent handler and fix Telegram send pipeline (#94)
* fix(channels): wire channel→agent handler and fix Telegram send pipeline

* format code

* add supported tests
2026-03-20 18:35:18 -07:00

34 lines
1.0 KiB
Python

from __future__ import annotations
def test_severity_policy_block():
from openjarvis.security.severity_policy import SeverityPolicy
from openjarvis.security.types import ThreatLevel
policy = SeverityPolicy()
assert policy.action_for(ThreatLevel.CRITICAL) == "block"
def test_severity_policy_warn():
from openjarvis.security.severity_policy import SeverityPolicy
from openjarvis.security.types import ThreatLevel
policy = SeverityPolicy()
assert policy.action_for(ThreatLevel.HIGH) == "warn"
def test_severity_policy_sanitize():
from openjarvis.security.severity_policy import SeverityPolicy
from openjarvis.security.types import ThreatLevel
policy = SeverityPolicy()
assert policy.action_for(ThreatLevel.MEDIUM) == "sanitize"
def test_severity_policy_log():
from openjarvis.security.severity_policy import SeverityPolicy
from openjarvis.security.types import ThreatLevel
policy = SeverityPolicy()
assert policy.action_for(ThreatLevel.LOW) == "log"