Orchestrata Ultimate › Tests › Reference › kernel › test_dispatcher

Tests reference — tests/kernel/test_dispatcher.py

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

Prose pending.

tests/kernel/test_dispatcher.py

source · 16 tests · 394 lines

Tests for kernel.dispatcher.

Covers: kernel.dispatcher, core.packet/ (package)

Kind Name Line Description
class TestDispatchStatus 43
method TestDispatchStatus.test_members 44
class TestDispatchAttempt 52
method TestDispatchAttempt.test_to_dict 53
class TestDispatchResult 67
method TestDispatchResult.test_success_result 68
method TestDispatchResult.test_add_attempt 80
class TestMessageDispatcherWebSocket 99
method TestMessageDispatcherWebSocket.test_dispatch_websocket 100 dispatch_websocket sends a packet and receives an ack.
class TestMessageDispatcherWebSocketErrors 144 Real-transport failure paths for _send_websocket / _exchange_websocket.
method TestMessageDispatcherWebSocketErrors.test_invalid_handshake_returns_false 152 A peer that answers the WS upgrade with a plain HTTP 404 makes
method TestMessageDispatcherWebSocketErrors.test_connection_refused_returns_false 179 Connecting to a bound-then-released port (nothing listening) raises
method TestMessageDispatcherWebSocketErrors.test_ack_timeout_returns_false 190 Server accepts the message but never acks; the dispatcher's
method TestMessageDispatcherWebSocketErrors.test_connection_closed_returns_false 211 Server closes right after receiving the payload, without acking;
class TestMessageDispatcherHttp 251 Real-transport tests for dispatch_http / _post_http.
method TestMessageDispatcherHttp.test_dispatch_http_2xx_returns_true 260 A 200 response makes dispatch_http return True.
method TestMessageDispatcherHttp.test_dispatch_http_non_2xx_returns_false 277 A 500 response makes dispatch_http return False (not raise).
method TestMessageDispatcherHttp.test_dispatch_http_connection_error_reraises 293 POSTing to a bound-then-released port (nothing listening) raises a
method TestMessageDispatcherHttp.test_dispatch_http_timeout_reraises 303 A server that sleeps past the dispatcher's timeout_seconds makes
method TestMessageDispatcherHttp.test_dispatch_http_response_error_reraises 321 A malformed HTTP status line makes aiohttp's parser raise
method TestMessageDispatcherHttp.test_dispatch_http_unexpected_error_reraises 346 A non-2xx response whose body cannot be decoded as UTF-8 makes
method TestMessageDispatcherHttp.test_dispatch_http_serialize_failure_raises_value_error 369 dispatch_http calls self._serialize_packet(packet) before