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

Method test_parse_upgrade

tests/test_headers.py:54–64  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

52 parse_connection(header)
53
54 def test_parse_upgrade(self):
55 for header, parsed in [
56 # Realistic use case
57 ("websocket", ["websocket"]),
58 # Synthetic example
59 ("http/3.0, websocket", ["http/3.0", "websocket"]),
60 # Pathological example
61 (",, WebSocket, \t,,", ["WebSocket"]),
62 ]:
63 with self.subTest(header=header):
64 self.assertEqual(parse_upgrade(header), parsed)
65
66 def test_parse_upgrade_invalid_header_format(self):
67 for header in ["???", "websocket 2", "http/3.0; websocket"]:

Callers

nothing calls this directly

Calls 1

parse_upgradeFunction · 0.85

Tested by

no test coverage detected