def test_addCookieSanitization(self):
        """
        L{http.Request.addCookie} replaces linear whitespace and
        semicolons with single spaces.
        """
        def cookieValue(key, value):
            return b'='.join([key, value])

        arguments = [('expires', b'Expires'),
                     ('domain', b'Domain'),
                     ('path', b'Path'),
                     ('max_age', b'Max-Age'),
                     ('comment', b'Comment')]

        inputsAndOutputs = list(
            zip(textLinearWhitespaceComponents +
                bytesLinearWhitespaceComponents,
                cycle([sanitizedBytes])))

        inputsAndOutputs = [
            ["Foo; bar", b"Foo  bar"],
            [b"Foo; bar", b"Foo  bar"],
        ]

        for inputValue, outputValue in inputsAndOutputs:
            self._checkCookie(cookieValue(outputValue, outputValue),
                              inputValue, inputValue)
            for argument, parameter in arguments:
                expected = b"; ".join([
                    cookieValue(outputValue, outputValue),
                    cookieValue(parameter, outputValue),
                ])
                self._checkCookie(expected, inputValue, inputValue,
                                  **{argument: inputValue})

        L{http.Request.addCookie} replaces linear whitespace and
        semicolons with single spaces.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py