def test_getChild(self):
        """
        L{_HostResource.getChild} returns the proper I{Resource} for the vhost
        embedded in the URL.  Verify that returning the proper I{Resource}
        required changing the I{Host} in the header.
        """
        bazroot = Data(b'root data', "")
        bazuri  = Data(b'uri data', "")
        baztest = Data(b'test data', "")
        bazuri.putChild(b'test', baztest)
        bazroot.putChild(b'uri', bazuri)
        hr = _HostResource()

        root = NameVirtualHost()
        root.default = Data(b'default data', "")
        root.addHost(b'baz.com', bazroot)

        request = DummyRequest([b'uri', b'test'])
        request.prepath = [b'bar', b'http', b'baz.com']
        request.site = Site(root)
        request.isSecure = lambda: False
        request.host = b''

        step = hr.getChild(b'baz.com', request) # Consumes rest of path
        self.assertIsInstance(step, Data)

        request = DummyRequest([b'uri', b'test'])
        step = root.getChild(b'uri', request)
        self.assertIsInstance(step, NoResource)

        L{_HostResource.getChild} returns the proper I{Resource} for the vhost
        embedded in the URL.  Verify that returning the proper I{Resource}
        required changing the I{Host} in the header.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_vhost.py