'A test for LP bug #704854 -- Exception thrown by registry
server is consumed by API server.
We start both servers daemonized.
We then use Glance API to try adding an image that does not
meet validation requirements on the registry server and test
that the error returned from the API server is appropriate'

def test_exception_not_eaten_from_registry_to_api(self):

    self.cleanup()
    self.start_servers()
    api_port = self.api_port
    path = ('http://127.0.0.1:%d/v1/images' % api_port)
    http = httplib2.Http()
    (response, content) = http.request(path, 'GET')
    self.assertEqual(http_client.OK, response.status)
    self.assertEqual('{"images":    []}', content)
    headers = {'Content-Type': 'application/octet-stream', 'X-Image-Meta-Name': 'ImageName', 'X-Image-Meta-Disk-Format': 'Invalid'}
    (ignored, content) = http.request(path, 'POST', headers=headers)
    self.assertIn('Invalid    disk    format', content, ("Could    not    find    'Invalid    disk    format'    in    output:    %s" % content))
    self.stop_servers()
