def test_netlocHostPort(self):
        """
        Parsing a I{URI} splits the network location component into I{host} and
        I{port}.
        """
        uri = client.URI.fromBytes(
            self.makeURIString(b'http://HOST:5144'))
        self.assertEqual(5144, uri.port)
        self.assertEqual(self.host, uri.host)
        self.assertEqual(self.uriHost + b':5144', uri.netloc)

        # Spaces in the hostname are trimmed, the default path is /.
        uri = client.URI.fromBytes(self.makeURIString(b'http://HOST '))
        self.assertEqual(self.uriHost, uri.netloc)

        Parsing a I{URI} splits the network location component into I{host} and
        I{port}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_webclient.py