'Tests creating an active image with explicitly zero size'

def test_add_image_zero_size(self):

    fixture_headers = {'x-image-meta-disk-format': 'ami', 'x-image-meta-container-format': 'ami', 'x-image-meta-size': '0', 'x-image-meta-name': 'empty    image'}
    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('active', res_body['status'])
    image_id = res_body['id']
    req = webob.Request.blank(('/images/%s' % image_id))
    res = req.get_response(self.api)
    self.assertEqual(http_client.OK, res.status_int)
    self.assertEqual(0, len(res.body))
