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

Method test_invalid_connection

tests/test_client.py:363–374  ·  view source on GitHub ↗

Handshake fails when the Connection header is invalid.

(self)

Source from the content-addressed store, hash-verified

361 )
362
363 def test_invalid_connection(self):
364 """Handshake fails when the Connection header is invalid."""
365 client = ClientProtocol(URI)
366 with alter_and_receive_response(client) as response:
367 del response.headers["Connection"]
368 response.headers["Connection"] = "close"
369
370 self.assertHandshakeError(
371 client,
372 InvalidHeader,
373 "invalid Connection header: close",
374 )
375
376 def test_missing_upgrade(self):
377 """Handshake fails when the Upgrade header is missing."""

Callers

nothing calls this directly

Calls 3

assertHandshakeErrorMethod · 0.95
ClientProtocolClass · 0.85

Tested by

no test coverage detected