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

Method test_missing_upgrade

tests/test_client.py:376–386  ·  view source on GitHub ↗

Handshake fails when the Upgrade header is missing.

(self)

Source from the content-addressed store, hash-verified

374 )
375
376 def test_missing_upgrade(self):
377 """Handshake fails when the Upgrade header is missing."""
378 client = ClientProtocol(URI)
379 with alter_and_receive_response(client) as response:
380 del response.headers["Upgrade"]
381
382 self.assertHandshakeError(
383 client,
384 InvalidHeader,
385 "missing Upgrade header",
386 )
387
388 def test_invalid_upgrade(self):
389 """Handshake fails when the Upgrade header is invalid."""

Callers

nothing calls this directly

Calls 3

assertHandshakeErrorMethod · 0.95
ClientProtocolClass · 0.85

Tested by

no test coverage detected