Client receives a failed handshake response.
(self, _generate_key)
| 77 | self.assertEqual(client.state, OPEN) |
| 78 | |
| 79 | def test_receive_failed_response(self, _generate_key): |
| 80 | """Client receives a failed handshake response.""" |
| 81 | client = ClientProtocol(URI) |
| 82 | client.receive_data( |
| 83 | ( |
| 84 | f"HTTP/1.1 404 Not Found\r\n" |
| 85 | f"Date: {DATE}\r\n" |
| 86 | f"Content-Length: 13\r\n" |
| 87 | f"Content-Type: text/plain; charset=utf-8\r\n" |
| 88 | f"Connection: close\r\n" |
| 89 | f"\r\n" |
| 90 | f"Sorry folks.\n" |
| 91 | ).encode(), |
| 92 | ) |
| 93 | |
| 94 | self.assertEqual(client.data_to_send(), [b""]) |
| 95 | self.assertTrue(client.close_expected()) |
| 96 | self.assertEqual(client.state, CONNECTING) |
| 97 | |
| 98 | |
| 99 | class RequestTests(unittest.TestCase): |
nothing calls this directly
no test coverage detected