Enable client library V2 to create an image.
Adds support for creating an image to the client library only, not the CLI. Replaced reference to deprecated BaseException.message Related to bp glance-client-v2 Change-Id: I8e3d09d89493368d22f7b1f69f79ebd2518e289d
This commit is contained in:
@@ -88,6 +88,15 @@ fixtures = {
|
||||
'',
|
||||
),
|
||||
},
|
||||
'/v2/images': {
|
||||
'POST': (
|
||||
{},
|
||||
{
|
||||
'id': '3a4560a1-e585-443e-9b39-553b46ec92d1',
|
||||
'name': 'image-1',
|
||||
},
|
||||
),
|
||||
},
|
||||
'v2/images/87b634c1-f893-33c9-28a9-e5673c99239a': {
|
||||
'DELETE': (
|
||||
{},
|
||||
@@ -329,6 +338,14 @@ class TestController(testtools.TestCase):
|
||||
self.assertEqual(image.id, '3a4560a1-e585-443e-9b39-553b46ec92d1')
|
||||
self.assertEqual(image.name, 'image-1')
|
||||
|
||||
def test_create_image(self):
|
||||
properties = {
|
||||
'name': 'image-1'
|
||||
}
|
||||
image = self.controller.create(**properties)
|
||||
self.assertEqual(image.id, '3a4560a1-e585-443e-9b39-553b46ec92d1')
|
||||
self.assertEqual(image.name, 'image-1')
|
||||
|
||||
def test_delete_image(self):
|
||||
self.controller.delete('87b634c1-f893-33c9-28a9-e5673c99239a')
|
||||
expect = [
|
||||
|
||||
Reference in New Issue
Block a user