def test_sanitizeLinearWhitespaceInRequestHeaders(self):
        """
        Linear whitespace in request headers is replaced with a single
        space.
        """
        for component in bytesLinearWhitespaceComponents:
            headers = Headers({component: [component],
                               b"host": [b"example.invalid"]})
            transport = StringTransport()
            Request(b'GET', b'/foo', headers, None).writeTo(transport)
            lines = transport.value().split(b'\r\n')
            self.assertEqual(lines[0], b"GET /foo HTTP/1.1")
            self.assertEqual(lines[-2:], [b"", b""])
            del lines[0], lines[-2:]
            lines.remove(b"Connection: close")
            lines.remove(b"Host: example.invalid")
            sanitizedHeaderLine = b": ".join([sanitizedBytes, sanitizedBytes])
            self.assertEqual(lines, [sanitizedHeaderLine])

        Linear whitespace in request headers is replaced with a single
        space.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_newclient.py