Orchestrata Ultimate › Tests › Reference › test_governance

Tests reference — tests/test_governance.py

Module of tests, split out because the directory page would be too large.

Prose pending.

tests/test_governance.py

source · 72 tests · 656 lines

Tests for orchestrata_ultimate.governance module.

Covers: governance.audit, governance.cache, governance.constants, governance.constitutional, governance.dynamic_policy, governance.exceptions, governance.monitoring, governance.types, governance.escalation_handler/ (package)

Kind Name Line Description
function test_decision_type_values 137
function test_violation_type_values 144
function test_article_priority_values 152
function test_policy_decision_defaults 164
function test_policy_decision_cache_hit_flag 172
function test_violation_defaults 184
function test_compliance_result_instantiation 191
function test_ethical_result_instantiation 197
function test_harm_assessment_instantiation 203
function test_access_result_instantiation 215
function test_safe_mode_status_inactive 221
function test_validation_result_no_errors 228
function test_article_dataclass 235
function test_governance_metrics_defaults 247
function test_governance_error_base 259
function test_policy_evaluation_error_is_governance 265
function test_constitutional_violation_error 270
function test_ethical_violation_error 276
function test_safe_mode_error 281
function test_policy_validation_error 286
function test_resource_access_error 291
function test_cache_error 296
function test_prolog_client_error 301
function test_audit_error 306
function test_cache_miss_returns_none 316
function test_cache_set_and_get_roundtrip 321
function test_cache_hit_rate_zero_initially 332
function test_cache_hit_rate_after_hit 337
function test_cache_stats_structure 347
function test_cache_clear_resets_counters 356
function test_cache_invalidate_clears_local 364
function test_cache_set_preserves_decision_type 371
function test_generate_cache_key_deterministic 384
function test_generate_cache_key_different_actions 390
function test_generate_cache_key_different_contexts 396
function test_generate_cache_key_length 402
function test_generate_cache_key_is_hex 407
function test_monitoring_initial_metrics 417
function test_monitoring_record_query_non_cached 424
function test_monitoring_record_query_cached 431
function test_monitoring_mixed_cache_hit_rate 437
function test_monitoring_record_violation 443
function test_monitoring_latency_percentiles 450
function test_monitoring_reset_clears_state 463
function test_monitoring_throughput_non_negative 471
function test_audit_log_decision_no_deps 483 log_decision should be a no-op when no graph/redis provided.
function test_audit_log_violation_no_deps 490 log_violation should be a no-op when no deps.
function test_audit_query_decisions_returns_empty 496
function test_audit_query_decisions_with_actor 502
function test_audit_get_audit_trail_returns_empty 508
function test_articles_count 518
function test_articles_have_required_fields 522
function test_critical_articles_constant 532
function test_article_numbers_are_sequential 536
function test_article_1_is_phase_1 541
function test_article_3_is_phase_1 546
function test_article_titles_are_unique 551
function test_constitutional_enforcer_get_articles 556 get_articles() does not call Prolog — just returns self._articles dict.
function test_constitutional_enforcer_get_article_by_number 565
function test_constitutional_enforcer_get_article_missing_returns_none 573
function test_safe_mode_constants 585
function test_cache_local_max_size_positive 591
function test_cache_local_ttl_positive 595
function test_dynamic_policy_initial_version 604
function test_dynamic_policy_initial_rule_count 610
function test_dynamic_policy_get_rules_empty 616
function test_escalation_status_values 628
function test_conflict_type_values 634
function test_resolution_strategy_values 639
function test_resolution_status_values 644
function test_log_notification_channel_instantiation 649
function test_log_notification_channel_custom_logger 654