    def test_http11_generator(self):
        body = string.ascii_letters
        to_send = "GET / HTTP/1.1\n" "Content-Length: %s\n\n" % len(body)
        to_send += body
        to_send = tobytes(to_send)
        self.connect()
        self.sock.send(to_send)
        fp = self.sock.makefile("rb")
        line, headers, response_body = read_http(fp)
        self.assertline(line, "200", "OK", "HTTP/1.1")
        expected = b""
        for chunk in chunks(body, 10):
            expected += tobytes(
                "%s\r\n%s\r\n" % (str(hex(len(chunk))[2:].upper()), chunk)
            )
        expected += b"0\r\n\r\n"
        self.assertEqual(response_body, expected)
        # connection is always closed at the end of a chunked response
        self.send_check_error(to_send)
        self.assertRaises(ConnectionClosed, read_http, fp)