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

Method test_parse_connection

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

Source from the content-addressed store, hash-verified

35 )
36
37 def test_parse_connection(self):
38 for header, parsed in [
39 # Realistic use cases
40 ("Upgrade", ["Upgrade"]), # Safari, Chrome
41 ("keep-alive, Upgrade", ["keep-alive", "Upgrade"]), # Firefox
42 # Pathological example
43 (",,\t, , ,Upgrade ,,", ["Upgrade"]),
44 ]:
45 with self.subTest(header=header):
46 self.assertEqual(parse_connection(header), parsed)
47
48 def test_parse_connection_invalid_header_format(self):
49 for header in ["???", "keep-alive; Upgrade"]:

Callers

nothing calls this directly

Calls 1

parse_connectionFunction · 0.85

Tested by

no test coverage detected