def test_getChild(self):
        """
        L{NameVirtualHost.getChild} returns correct I{Resource} based off
        the header and modifies I{Request} to ensure proper prepath and
        postpath are set.
        """
        virtualHostResource = NameVirtualHost()
        leafResource = Data(b"leaf data", "")
        leafResource.isLeaf = True
        normResource = Data(b"norm data", "")
        virtualHostResource.addHost(b'leaf.example.org', leafResource)
        virtualHostResource.addHost(b'norm.example.org', normResource)

        request = DummyRequest([])
        request.requestHeaders.addRawHeader(b'host', b'norm.example.org')
        request.prepath = [b'']

        self.assertIsInstance(virtualHostResource.getChild(b'', request),
                              NoResource)
        self.assertEqual(request.prepath, [b''])
        self.assertEqual(request.postpath, [])

        request = DummyRequest([])
        request.requestHeaders.addRawHeader(b'host', b'leaf.example.org')
        request.prepath = [b'']

        self.assertIsInstance(virtualHostResource.getChild(b'', request),
                              Data)
        self.assertEqual(request.prepath,  [])
        self.assertEqual(request.postpath, [b''])

        L{NameVirtualHost.getChild} returns correct I{Resource} based off
        the header and modifies I{Request} to ensure proper prepath and
        postpath are set.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_vhost.py