def test_writeHeadersSanitizesLinearWhitespace(self):
        """
        L{HTTPChannel.writeHeaders} removes linear whitespace from the
        list of header names and values it receives.
        """
        for component in bytesLinearWhitespaceComponents:
            transport = StringTransport()
            channel = http.HTTPChannel()
            channel.makeConnection(transport)

            channel.writeHeaders(
                version=b"HTTP/1.1",
                code=b"200",
                reason=b"OK",
                headers=[(component, component)])

            sanitizedHeaderLine = b": ".join([
                sanitizedBytes, sanitizedBytes,
            ]) + b'\r\n'

            self.assertEqual(
                transport.value(),
                b"\r\n".join([
                    b"HTTP/1.1 200 OK",
                    sanitizedHeaderLine,
                    b'',
                ]))

        L{HTTPChannel.writeHeaders} removes linear whitespace from the
        list of header names and values it receives.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py