Orchestrata Ultimate › Tests › Reference › postman › test_governance
Tests reference — tests/postman/test_governance.py
Module of tests/postman, split out because the directory page would be too large.
Prose pending.
tests/postman/test_governance.py
source · 115 tests · 1133 lines
Tests for Postman governance integration - NO MOCKING.
Covers: core.paths, core.prolog_adapter, postman.governance, postman.types
| Kind | Name | Line | Description |
|---|---|---|---|
| class | TestAuthResult |
30 | Test AuthResult dataclass. |
| method | TestAuthResult.test_auth_result_init_authorized |
33 | |
| method | TestAuthResult.test_auth_result_init_unauthorized |
40 | |
| method | TestAuthResult.test_auth_result_with_audit_id |
47 | |
| class | TestPostmanGovernanceManagerInit |
52 | Test PostmanGovernanceManager initialization. |
| method | TestPostmanGovernanceManagerInit.test_init_creates_empty_audit_log |
55 | |
| method | TestPostmanGovernanceManagerInit.test_init_creates_empty_rule_cache |
60 | |
| method | TestPostmanGovernanceManagerInit.test_init_sets_cache_ttl |
65 | |
| method | TestPostmanGovernanceManagerInit.test_a_known_agent_can_have_recipients_registered |
69 | What the recipient map is FOR — not how it is pre-populated. |
| method | TestPostmanGovernanceManagerInit.test_construction_does_not_consult_the_rule_base |
92 | The laziness contract, pinned. |
| method | TestPostmanGovernanceManagerInit.test_agent_permissions_defined |
111 | |
| method | TestPostmanGovernanceManagerInit.test_topic_owners_defined |
116 | |
| method | TestPostmanGovernanceManagerInit.test_queue_owners_defined |
121 | |
| class | TestCheckSendAuthority |
127 | Test check_send_authority method. |
| method | TestCheckSendAuthority.test_orchestrator_has_universal_send_authority |
130 | |
| method | TestCheckSendAuthority.test_unknown_sender_denied |
137 | |
| method | TestCheckSendAuthority.test_registered_recipient_authorized |
147 | |
| method | TestCheckSendAuthority.test_permission_based_authorization |
155 | |
| method | TestCheckSendAuthority.test_no_permission_denied |
161 | |
| method | TestCheckSendAuthority.test_postman_has_queue_permissions |
168 | |
| class | TestCheckTopicAuthority |
176 | Test check_topic_authority method. |
| method | TestCheckTopicAuthority.test_orchestrator_has_universal_topic_authority |
179 | |
| method | TestCheckTopicAuthority.test_postman_can_create_topics |
186 | |
| method | TestCheckTopicAuthority.test_postman_can_delete_topics |
193 | |
| method | TestCheckTopicAuthority.test_topic_owner_can_publish |
199 | |
| method | TestCheckTopicAuthority.test_non_owner_publish_denied |
207 | |
| method | TestCheckTopicAuthority.test_all_agents_can_subscribe |
215 | |
| method | TestCheckTopicAuthority.test_permission_based_topic_access |
222 | |
| class | TestCheckQueueAuthority |
231 | Test check_queue_authority method. |
| method | TestCheckQueueAuthority.test_orchestrator_has_universal_queue_authority |
234 | |
| method | TestCheckQueueAuthority.test_postman_has_universal_queue_authority |
241 | |
| method | TestCheckQueueAuthority.test_queue_owner_can_enqueue |
248 | |
| method | TestCheckQueueAuthority.test_queue_owner_can_create |
256 | |
| method | TestCheckQueueAuthority.test_queue_owner_can_purge |
262 | |
| method | TestCheckQueueAuthority.test_queue_owner_can_delete |
268 | |
| method | TestCheckQueueAuthority.test_queue_owner_can_dequeue |
274 | |
| method | TestCheckQueueAuthority.test_non_owner_enqueue_denied |
281 | |
| method | TestCheckQueueAuthority.test_non_owner_dequeue_denied |
289 | |
| class | TestCheckAdminAuthority |
296 | Test check_admin_authority method. |
| method | TestCheckAdminAuthority.test_orchestrator_has_admin_authority |
299 | |
| method | TestCheckAdminAuthority.test_postman_has_queue_admin_authority |
306 | |
| method | TestCheckAdminAuthority.test_postman_has_topic_admin_authority |
313 | |
| method | TestCheckAdminAuthority.test_non_admin_denied |
319 | |
| method | TestCheckAdminAuthority.test_postman_denied_non_queue_topic_admin |
326 | |
| class | TestHasPermission |
333 | Test permission checking via public API (check_send_authority, check_queue_authority). |
| method | TestHasPermission.test_wildcard_permission |
336 | |
| method | TestHasPermission.test_exact_permission_match |
342 | |
| method | TestHasPermission.test_category_wildcard_match |
348 | |
| method | TestHasPermission.test_no_permission |
354 | |
| method | TestHasPermission.test_unknown_agent |
360 | |
| class | TestRecipientRegistration |
369 | Test recipient registration methods. |
| method | TestRecipientRegistration.test_register_recipient |
372 | |
| method | TestRecipientRegistration.test_register_multiple_recipients |
377 | |
| method | TestRecipientRegistration.test_unregister_recipient |
384 | |
| method | TestRecipientRegistration.test_unregister_non_existent_recipient |
390 | |
| method | TestRecipientRegistration.test_register_for_new_agent |
397 | |
| class | TestAuditLogging |
405 | Test audit logging functionality. |
| method | TestAuditLogging.test_audit_log_created_on_check |
408 | |
| method | TestAuditLogging.test_audit_log_contains_context |
415 | |
| method | TestAuditLogging.test_audit_log_contains_decision |
425 | |
| method | TestAuditLogging.test_audit_log_contains_timestamp |
433 | |
| method | TestAuditLogging.test_get_audit_log |
442 | |
| method | TestAuditLogging.test_get_audit_log_non_existent |
449 | |
| method | TestAuditLogging.test_get_all_audit_logs |
454 | |
| class | TestEscalationPath |
462 | Test escalation path functionality. |
| method | TestEscalationPath.test_escalation_path_for_unknown_sender |
465 | |
| method | TestEscalationPath.test_escalation_path_for_insufficient_permission |
472 | |
| method | TestEscalationPath.test_no_escalation_path_when_authorized |
478 | |
| class | TestMessageTypePermissions |
484 | Test message type-specific permissions. |
| method | TestMessageTypePermissions.test_all_message_types |
487 | |
| class | TestTopicOwnership |
505 | Test topic ownership definitions. |
| method | TestTopicOwnership.test_all_topic_owners_defined |
508 | |
| method | TestTopicOwnership.test_codedirector_owns_code_topics |
527 | |
| method | TestTopicOwnership.test_ux_owns_design_topics |
532 | |
| method | TestTopicOwnership.test_pm_owns_project_topics |
537 | |
| method | TestTopicOwnership.test_architect_owns_architecture_topics |
542 | |
| method | TestTopicOwnership.test_qa_owns_quality_topics |
547 | |
| method | TestTopicOwnership.test_concierge_owns_request_topics |
552 | |
| class | TestQueueOwnership |
558 | Test queue ownership definitions. |
| method | TestQueueOwnership.test_all_queue_owners_defined |
561 | |
| method | TestQueueOwnership.test_orchestrator_owns_orchestrator_queue |
576 | |
| method | TestQueueOwnership.test_postman_owns_postman_queue |
580 | |
| method | TestQueueOwnership.test_codedirector_owns_codedirector_queue |
584 | |
| class | TestAgentPermissions |
589 | Test agent permission definitions. |
| method | TestAgentPermissions.test_orchestrator_has_universal_permission |
592 | |
| method | TestAgentPermissions.test_postman_has_queue_delivery_permissions |
596 | |
| method | TestAgentPermissions.test_codedirector_has_code_permissions |
604 | |
| method | TestAgentPermissions.test_ux_has_design_permissions |
611 | |
| method | TestAgentPermissions.test_pm_has_project_permissions |
618 | |
| method | TestAgentPermissions.test_architect_has_architecture_permissions |
625 | |
| method | TestAgentPermissions.test_qa_has_quality_permissions |
632 | |
| method | TestAgentPermissions.test_concierge_has_intake_permissions |
639 | |
| class | TestPrologIntegration |
647 | Test Prolog rule caching via authorization checks (indirect testing). |
| method | TestPrologIntegration.test_authorization_check_returns_result |
650 | |
| method | TestPrologIntegration.test_multiple_authorization_checks_consistent |
657 | |
| method | TestPrologIntegration.test_different_authorization_contexts |
670 | |
| class | TestRuleCache |
683 | Test rule caching functionality. |
| method | TestRuleCache.test_cache_stores_result_and_timestamp |
686 | |
| method | TestRuleCache.test_cache_ttl_configured |
695 | |
| class | TestQueryPrologReal |
700 | Tests for the REAL Prolog evaluation in _query_prolog — real |
| method | TestQueryPrologReal.test_allow_path_orchestrator_universal_admin_authority |
708 | U:Ox has universal admin authority — admin_authority/2 succeeds. |
| method | TestQueryPrologReal.test_deny_path_agent_without_admin_authority |
714 | U:Cx has no admin authority for any operation — admin_authority/2 |
| method | TestQueryPrologReal.test_send_authority_allow_path_via_agent_permission |
721 | U:Cd has send.code permission — send_authority/3 succeeds for a |
| method | TestQueryPrologReal.test_send_authority_deny_path_for_unpermitted_agent |
728 | U:Qa has no send.code permission and does not own the code topic |
| method | TestQueryPrologReal.test_unknown_predicate_fails_closed |
735 | An undefined predicate raises a real Prolog existence_error; |
| method | TestQueryPrologReal.test_placeholder_always_false_behavior_is_gone |
744 | Regression for the SPEC-002 gap: the OLD implementation always |
| method | TestQueryPrologReal.test_query_prolog_caches_real_result |
753 | A real (non-placeholder) query result is cached under the |
| method | TestQueryPrologReal.test_injected_prolog_engine_seam_is_used |
765 | The constructor's prolog_engine seam is honored: a caller- |
| method | TestQueryPrologReal.test_broken_rules_path_fails_closed |
778 | A rule base that fails to consult (real syntax error, real |
| method | TestQueryPrologReal.test_nonexistent_rules_path_fails_closed_at_ensure_ready |
804 | When _ensure_prolog_ready itself raises (real |
| method | TestQueryPrologReal.test_second_query_reuses_ready_engine |
816 | The second _query_prolog call on the same manager hits the |
| method | TestQueryPrologReal.test_query_prolog_renders_int_and_bool_args |
826 | _to_prolog_term must render ints/floats as-is and bools as the |
| method | TestQueryPrologReal.test_query_prolog_zero_arity_goal |
837 | A predicate called with no args builds a bare-atom goal (no |
| class | TestComplexAuthorizationScenarios |
845 | Test complex multi-step authorization scenarios. |
| method | TestComplexAuthorizationScenarios.test_code_review_workflow |
848 | |
| method | TestComplexAuthorizationScenarios.test_task_assignment_workflow |
869 | |
| method | TestComplexAuthorizationScenarios.test_escalation_workflow |
883 | |
| class | TestEdgeCases |
896 | Test edge cases and boundary conditions. |
| method | TestEdgeCases.test_empty_topic_name |
899 | |
| method | TestEdgeCases.test_empty_queue_name |
905 | |
| method | TestEdgeCases.test_invalid_operation |
911 | |
| method | TestEdgeCases.test_case_sensitive_agent_ids |
917 | |
| method | TestEdgeCases.test_multiple_audit_logs_independent |
923 | |
| class | TestConcurrentOperations |
938 | Test concurrent authorization checks. |
| method | TestConcurrentOperations.test_concurrent_send_checks |
941 | |
| method | TestConcurrentOperations.test_concurrent_topic_checks |
960 | |
| method | TestConcurrentOperations.test_concurrent_queue_checks |
976 | |
| class | TestPrologAuditCrossCheck |
993 | The AUDIT-ONLY Prolog cross-check wired into _make_decision: every |
| method | TestPrologAuditCrossCheck.test_send_decision_records_prolog_verdict_in_audit |
1000 | |
| method | TestPrologAuditCrossCheck.test_admin_decision_divergence_is_recorded_not_enforced |
1009 | A denied Python decision with a Prolog-side equivalent still |
| method | TestPrologAuditCrossCheck.test_topic_and_queue_decisions_carry_prolog_fields |
1020 | |
| method | TestPrologAuditCrossCheck.test_context_without_rule_base_equivalent_maps_to_none |
1030 | Contexts with no Prolog-side predicate (no sender / unknown |
| method | TestPrologAuditCrossCheck.test_goal_mapping_shapes |
1043 | |
| class | TestPermissionTablesHaveOneSource |
1063 | The permission tables must live in exactly one place. |
| method | TestPermissionTablesHaveOneSource.test_agent_permissions_match_the_rule_base_row_for_row |
1085 | |
| method | TestPermissionTablesHaveOneSource.test_topic_and_queue_owners_match_the_rule_base |
1105 | |
| method | TestPermissionTablesHaveOneSource.test_the_python_module_carries_no_literal_permission_table |
1116 | The row-for-row tests above pass whether there is one source or two |