'L{NameVirtualHost.render} returns the result of rendering the resource
which is the value in the instance\'s C{host} dictionary corresponding
to the key indicated by the value of the I{Host} header in the request.'

def test_renderWithHost(self):

    virtualHostResource = NameVirtualHost()
    virtualHostResource.addHost('example.org', Data('winner', ''))
    request = DummyRequest([''])
    request.requestHeaders.addRawHeader('host', 'example.org')
    d = _render(virtualHostResource, request)
    def cbRendered(ignored, request):
        self.assertEqual(''.join(request.written), 'winner')
    d.addCallback(cbRendered, request)
    requestWithPort = DummyRequest([''])
    requestWithPort.requestHeaders.addRawHeader('host', 'example.org:8000')
    dWithPort = _render(virtualHostResource, requestWithPort)
    def cbRendered(ignored, requestWithPort):
        self.assertEqual(''.join(requestWithPort.written), 'winner')
    dWithPort.addCallback(cbRendered, requestWithPort)
    return gatherResults([d, dWithPort])
