| 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 |
|
|