File size: 1,006 Bytes
0f16e07 | 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 34 35 36 37 38 | import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT))
from inference import predict_governance_risk
def test_high_risk_scenario():
result = predict_governance_risk({
"sector": "financial_services",
"impact": "high",
"decision_autonomy": "automated",
"human_oversight": "none",
"monitoring": "none",
"traceability": "none",
"technical_documentation": "partial",
})
assert result["risk_tier"] == "unacceptable"
assert "class_probabilities" in result
def test_lower_risk_scenario():
result = predict_governance_risk({
"sector": "enterprise_productivity",
"impact": "low",
"decision_autonomy": "assistive",
"human_oversight": "strong",
"monitoring": "strong",
"traceability": "strong",
"technical_documentation": "strong",
})
assert result["risk_tier"] == "lower"
assert "class_probabilities" in result
|