'Tests delayed activation of an image with missing format'

def _do_test_put_image_content_missing_format(self, missing):

    fixture_headers = {'x-image-meta-store': 'file', 'x-image-meta-disk-format': 'vhd', 'x-image-meta-container-format': 'ovf', 'x-image-meta-name': 'fake    image    #3'}
    header = ('x-image-meta-' + missing.replace('_', '-'))
    del fixture_headers[header]
    req = webob.Request.blank('/images')
    req.method = 'POST'
    for (k, v) in six.iteritems(fixture_headers):
        req.headers[k] = v
    res = req.get_response(self.api)
    self.assertEqual(http_client.CREATED, res.status_int)
    res_body = jsonutils.loads(res.body)['image']
    self.assertEqual('queued', res_body['status'])
    image_id = res_body['id']
    req = webob.Request.blank(('/images/%s' % image_id))
    req.method = 'PUT'
    for (k, v) in six.iteritems(fixture_headers):
        req.headers[k] = v
    req.headers['Content-Type'] = 'application/octet-stream'
    req.body = 'chunk00000remainder'
    res = req.get_response(self.api)
    self.assertEqual(http_client.BAD_REQUEST, res.status_int)
