'Tests creates a queued image for no body and no loc header'

def test_add_image_no_location_no_image_as_body(self):

    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', 'x-image-created_at': '2015-11-20', 'x-image-updated_at': '2015-12-01    12:10:01', 'x-image-deleted_at': '2000'}
    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'
    req.headers['x-image-meta-location'] = 'http://localhost:0/images/123'
    http = store.get_store_from_scheme('http')
    with mock.patch.object(http, 'get_size') as mocked_size:
        mocked_size.return_value = 0
        res = req.get_response(self.api)
        self.assertEqual(http_client.OK, res.status_int)
    res_body = jsonutils.loads(res.body)['image']
    self.assertEqual('active', res_body['status'])
    self.assertNotIn('location', res_body)
