'Test image download returns HTTPBadRequest.
Make sure that serializer returns 400 bad request error in case of
getting images from this store is not supported at specified location.'

def test_download_store_get_not_support(self):

    with mock.patch.object(glance.api.policy.ImageProxy, 'get_data') as mock_get_data:
        mock_get_data.side_effect = glance_store.StoreGetNotSupported()
        request = wsgi.Request.blank('/')
        response = webob.Response()
        response.request = request
        image = FakeImage(size=3, data=iter('ZZZ'))
        image.get_data = mock_get_data
        self.assertRaises(webob.exc.HTTPBadRequest, self.serializer.download, response, image)
