'Tests to add a basic image in the file store'

def test_add_image_basic_file_store(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'}
    req = webob.Request.blank('/images')
    req.method = 'POST'
    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.CREATED, res.status_int)
    self.assertIn('location', res.headers, ("'location'    not    in    response    headers.\nres.headerlist    =    %r" % res.headerlist))
    res_body = jsonutils.loads(res.body)['image']
    self.assertIn(('/images/%s' % res_body['id']), res.headers['location'])
    self.assertEqual('active', res_body['status'])
    image_id = res_body['id']
    req = webob.Request.blank(('/images/%s' % image_id))
    req.method = 'PUT'
    url = self._http_loc_url('/images/123')
    req.headers['x-image-meta-location'] = url
    res = req.get_response(self.api)
    self.assertEqual(http_client.BAD_REQUEST, res.status_int)
