def test_create_server_image_too_large(self):
image_uuid = '76fa36fc-c930-4bf3-8c8a-ea2a2420deb6'
# Get the fake image service so we can update the size of the image
(image_service, image_id) = glance.get_remote_image_service(context,
image_uuid)
image = image_service.show(context, image_id)
orig_size = image['size']
new_size = str(1000 * (1024 ** 3))
image_service.update(context, image_uuid, {'size': new_size})
self.addCleanup(image_service.update, context, image_uuid,
{'size': orig_size})
self.body['server']['flavorRef'] = 2
self.req.body = jsonutils.dump_as_bytes(self.body)
with testtools.ExpectedException(
webob.exc.HTTPBadRequest,
"Flavor's disk is too small for requested image."):
self.controller.create(self.req, self.body)
test_servers.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录