mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-28 13:26:48 +00:00
* fix(channels): wire channel→agent handler and fix Telegram send pipeline * format code * add supported tests
34 lines
1.0 KiB
Python
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"
|