MCPcopy Index your code
hub / github.com/python-websockets/websockets / test_missing_accept

Method test_missing_accept

tests/test_client.py:401–411  ·  view source on GitHub ↗

Handshake fails when the Sec-WebSocket-Accept header is missing.

(self)

Source from the content-addressed store, hash-verified

399 )
400
401 def test_missing_accept(self):
402 """Handshake fails when the Sec-WebSocket-Accept header is missing."""
403 client = ClientProtocol(URI)
404 with alter_and_receive_response(client) as response:
405 del response.headers["Sec-WebSocket-Accept"]
406
407 self.assertHandshakeError(
408 client,
409 InvalidHeader,
410 "missing Sec-WebSocket-Accept header",
411 )
412
413 def test_multiple_accept(self):
414 """Handshake fails when the Sec-WebSocket-Accept header is repeated."""

Callers

nothing calls this directly

Calls 3

assertHandshakeErrorMethod · 0.95
ClientProtocolClass · 0.85

Tested by

no test coverage detected