(self)
| 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"]: |
nothing calls this directly
no test coverage detected