'The actual bug was a HEAD response coming out with a body because the
Request object wasn\'t passed into the Response object\'s constructor.
The Response object\'s __call__ method should be able to reify a
Request object from the env it gets passed.'

def test_call_reifies_request_if_necessary(self):

    def test_app(environ, start_response):
        start_response('200    OK', [])
        return ['hi']
    req = swift.common.swob.Request.blank('/')
    req.method = 'HEAD'
    (status, headers, app_iter) = req.call_application(test_app)
    resp = swift.common.swob.Response(status=status, headers=dict(headers), app_iter=app_iter)
    output_iter = resp(req.environ, (lambda *_: None))
    self.assertEqual(list(output_iter), [''])
