Orchestrata Ultimate › Tests › Reference › postman › test_postman_extended

Tests reference — tests/postman/test_postman_extended.py

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

Prose pending.

tests/postman/test_postman_extended.py

source · 65 tests · 1006 lines

Comprehensive extended tests for postman.postman.

Covers: postman.postman, core.interfaces/ (package), core.packet/ (package)

Kind Name Line Description
class TestInitialization 125 Test Postman initialization and lifecycle methods.
method TestInitialization.test_init_with_config 129 Test initialization with custom config dictionary.
method TestInitialization.test_init_with_graph_repository 137 Test initialization with graph_repository parameter.
method TestInitialization.test_initialize_updates_config 143 Test initialize() merges config into existing config.
method TestInitialization.test_start_sets_running 150 Test start() sets _running to True.
method TestInitialization.test_stop_sets_not_running 156 Test stop() sets _running to False.
class TestHealthAndMetadata 168 Test health reporting and metadata retrieval.
method TestHealthAndMetadata.test_get_health_stopped 172 Test health returns STOPPED when not running.
method TestHealthAndMetadata.test_get_health_degraded 179 Test health returns DEGRADED when running but Redis unavailable.
method TestHealthAndMetadata.test_get_health_healthy 187 Test health returns HEALTHY when running and Redis OK.
method TestHealthAndMetadata.test_get_metadata 194 Test get_metadata returns ComponentMetadata.
class TestRegistration 208 Test handler registration.
method TestRegistration.test_register_handler 211 Test registering a handler for an agent.
method TestRegistration.test_register_overwrite 221 Test registering a handler overwrites existing.
method TestRegistration.test_register_multiple_agents 234 Test registering handlers for multiple agents.
class TestRouting 246 Test packet routing (route method).
method TestRouting.test_route_missing_to_header 250 Test route returns failure when TO header is missing.
method TestRouting.test_route_successful_delivery 271 Test route returns DELIVERED when handler succeeds.
method TestRouting.test_route_queued_no_handler 286 Test route returns QUEUED when no handler registered.
method TestRouting.test_route_handler_exception 296 Test route returns QUEUED when handler raises exception.
method TestRouting.test_route_async_handler 310 Test route with async handler that succeeds.
method TestRouting.test_route_async_handler_exception 324 Test route with async handler that raises exception.
class TestAsyncRoute 343 Test async route (aroute method).
method TestAsyncRoute.test_aroute_missing_destination 347 Test aroute returns None when destination is missing.
method TestAsyncRoute.test_aroute_sync_handler 361 Test aroute with sync handler returning response.
method TestAsyncRoute.test_aroute_async_handler 376 Test aroute with async handler returning response.
method TestAsyncRoute.test_aroute_handler_exception 392 Test aroute returns None when handler raises exception.
method TestAsyncRoute.test_aroute_no_handler 405 Test aroute returns None when no handler registered.
method TestAsyncRoute.test_aroute_handler_returns_none 413 Test aroute returns None when handler returns None.
class TestEnqueueDequeueInMemory 431 Test enqueue and dequeue with in-memory fallback.
method TestEnqueueDequeueInMemory.test_enqueue_returns_packet_id 435 Test enqueue returns a packet ID.
method TestEnqueueDequeueInMemory.test_enqueue_uses_existing_packet_id 444 Test enqueue uses PACKET_ID from headers if present.
method TestEnqueueDequeueInMemory.test_enqueue_dequeue_roundtrip 452 Test enqueue followed by dequeue returns the same packet.
method TestEnqueueDequeueInMemory.test_dequeue_empty_queue 462 Test dequeue returns None for empty queue.
method TestEnqueueDequeueInMemory.test_dequeue_fifo_order 469 Test dequeue returns entries in FIFO order.
method TestEnqueueDequeueInMemory.test_enqueue_with_priority 485 Test enqueue with custom priority.
method TestEnqueueDequeueInMemory.test_enqueue_packet_without_to_dict 494 Test enqueue handles packet without to_dict method.
class TestQueueStatus 521 Test get_queue_status method.
method TestQueueStatus.test_get_queue_status_empty 525 Test queue status for empty queue.
method TestQueueStatus.test_get_queue_status_with_pending 536 Test queue status reflects pending entries.
method TestQueueStatus.test_get_queue_status_all_queues 548 Test queue status across all queues when no volk_id given.
method TestQueueStatus.test_get_queue_status_with_delivering 564 Test queue status includes delivering count.
method TestQueueStatus.test_get_queue_status_with_failed 575 Test queue status includes failed count.
class TestAcknowledge 591 Test acknowledge method.
method TestAcknowledge.test_acknowledge_existing_packet 595 Test acknowledge removes packet from delivering.
method TestAcknowledge.test_acknowledge_nonexistent_packet 605 Test acknowledge does nothing for non-existent packet.
class TestRetryFailed 618 Test retry_failed method.
method TestRetryFailed.test_retry_failed_not_found 622 Test retry returns error when packet not in failed queue.
method TestRetryFailed.test_retry_failed_max_retries_exceeded 630 Test retry returns error when max retries exceeded.
method TestRetryFailed.test_retry_failed_success 641 Test retry moves packet from failed to delivering.
method TestRetryFailed.test_retry_failed_first_retry 655 Test retry on first failure (retries=0).
class TestRedisIntegration 672 Test Redis-backed paths using real Redis.
method TestRedisIntegration.test_enqueue_with_redis 692 Test enqueue stores entry in Redis.
method TestRedisIntegration.test_dequeue_with_redis 704 Test dequeue retrieves entry from Redis.
method TestRedisIntegration.test_dequeue_empty_redis_queue 720 Test dequeue returns None for empty Redis queue.
method TestRedisIntegration.test_persist_packet_with_redis 727 Test _persist_packet stores packet in Redis thread list.
method TestRedisIntegration.test_persist_packet_no_redis 746 Test _persist_packet returns early when Redis unavailable.
method TestRedisIntegration.test_get_queue_status_with_redis 754 Test get_queue_status counts Redis queue entries.
method TestRedisIntegration.test_redis_enqueue_failure_fallback 767 Test enqueue falls back to in-memory when Redis fails.
method TestRedisIntegration.test_redis_dequeue_failure_fallback 785 Test dequeue falls back to in-memory when Redis fails.
method TestRedisIntegration.test_get_queue_status_all_queues_with_redis 801 Test get_queue_status scans all Redis queues when no volk_id given.
class TestDeliveryResult 823 Test DeliveryResult dataclass behavior.
method TestDeliveryResult.test_delivery_result_defaults 826 Test DeliveryResult with default values.
method TestDeliveryResult.test_delivery_result_full 836 Test DeliveryResult with all fields set.
method TestDeliveryResult.test_delivery_result_failed 851 Test DeliveryResult for failed delivery.
class TestErrorHandling 868 Test various error handling paths.
method TestErrorHandling.test_deliver_to_handler_no_handler 872 Test _deliver_to_handler returns False when no handler exists.
method TestErrorHandling.test_deliver_to_handler_sync_success 880 Test _deliver_to_handler with successful sync handler.
method TestErrorHandling.test_deliver_to_handler_async_success 893 Test _deliver_to_handler with successful async handler.
method TestErrorHandling.test_deliver_to_handler_exception 906 Test _deliver_to_handler returns False on handler exception.
method TestErrorHandling.test_in_memory_fallback_enqueue_creates_queue 919 Test _in_memory_fallback_enqueue creates queue if missing.
method TestErrorHandling.test_aroute_persist_called 928 Test aroute calls _persist_packet before delivery.
method TestErrorHandling.test_route_enqueues_before_delivery 950 Test route enqueues packet before attempting delivery.
method TestErrorHandling.test_get_queue_status_redis_llen_exception 966 Test get_queue_status handles Redis llen exception gracefully.
method TestErrorHandling.test_persist_packet_redis_exception 979 Test _persist_packet handles Redis exception gracefully.
method TestErrorHandling.test_enqueue_redis_exception_sets_flag 990 Test enqueue sets _redis_ok=False on Redis exception.
method TestErrorHandling.test_dequeue_redis_exception_sets_flag 1001 Test dequeue sets _redis_ok=False on Redis exception.