def test_serverNameIsNativeString(self):
        """
        The C{'SERVER_NAME'} key of the C{environ} C{dict} passed to the
        application is always a native string.
        """
        for serverName in b"host.example.com", u"host.example.com":
            request, result = self.prepareRequest()
            # This is kind of a cheat; getRequestHostname() breaks in Python 3
            # when the "Host" request header is set to a native string because
            # it tries to split around b":", so we patch the method.
            request.getRequestHostname = lambda: serverName
            request.requestReceived()
            result.addCallback(self.environKeyEqual('SERVER_NAME', 'host.example.com'))
            self.assertIsInstance(self.successResultOf(result), str)

        The C{'SERVER_NAME'} key of the C{environ} C{dict} passed to the
        application is always a native string.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_wsgi.py