def test_setHostNonDefaultPort(self):
        """
        L{http.Request.setHost} sets the value of the host request header.
        The port should be added because it is not the default.
        """
        req = http.Request(DummyChannel(), False)
        req.setHost(b"example.com", 81)
        self.assertEqual(
            req.requestHeaders.getRawHeaders(b"host"), [b"example.com:81"])

        L{http.Request.setHost} sets the value of the host request header.
        The port should be added because it is not the default.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py