'If L{None} is passed to L{Agent.request} for the C{headers} parameter,
a L{Headers} instance is created for the request and a I{Host} header
added to it.'

def test_hostProvided(self):

    self.agent._getEndpoint = (lambda *args: self)
    self.agent.request('GET', 'http://example.com/foo?bar')
    (req, res) = self.protocol.requests.pop()
    self.assertEqual(req.headers.getRawHeaders('host'), ['example.com'])
