Cleanup in test_images and image_fakes
Unused code was removed in fixture_data/images.py for unknown image requests that relate to v2/images.py and test_images for them. Change-Id: I7e31a572116b1e5cf0df9f431f8e53470d27d066
This commit is contained in:
parent
7e7764ced5
commit
9f4d64a1bf
novaclient/tests/unit
@ -67,25 +67,6 @@ class V1(base.Fixture):
|
||||
json={'image': image_1},
|
||||
headers=headers)
|
||||
|
||||
self.requests.register_uri('GET', self.url(2),
|
||||
json={'image': image_2},
|
||||
headers=headers)
|
||||
|
||||
self.requests.register_uri('GET', self.url(456),
|
||||
json={'image': image_2},
|
||||
headers=headers)
|
||||
|
||||
def post_images(request, context):
|
||||
body = jsonutils.loads(request.body)
|
||||
assert list(body) == ['image']
|
||||
fakes.assert_has_keys(body['image'], required=['serverId', 'name'])
|
||||
return images_1
|
||||
|
||||
self.requests.register_uri('POST', self.url(),
|
||||
json=post_images,
|
||||
headers=headers,
|
||||
status_code=202)
|
||||
|
||||
def post_images_1_metadata(request, context):
|
||||
body = jsonutils.loads(request.body)
|
||||
assert list(body) == ['metadata']
|
||||
@ -96,17 +77,9 @@ class V1(base.Fixture):
|
||||
json=post_images_1_metadata,
|
||||
headers=headers)
|
||||
|
||||
for u in (1, 2, '1/metadata/test_key'):
|
||||
for u in (1, '1/metadata/test_key'):
|
||||
self.requests.register_uri('DELETE', self.url(u), status_code=204)
|
||||
|
||||
image_headers = {'x-image-meta-id': '1',
|
||||
'x-image-meta-name': 'CentOS 5.2',
|
||||
'x-image-meta-updated': '2010-10-10T12:00:00Z',
|
||||
'x-image-meta-created': '2010-10-10T12:00:00Z',
|
||||
'x-image-meta-status': 'ACTIVE',
|
||||
'x-image-meta-property-test-key': 'test_value'}
|
||||
self.requests.register_uri('HEAD', self.url(1), headers=image_headers)
|
||||
|
||||
|
||||
class V3(V1):
|
||||
|
||||
|
@ -26,6 +26,7 @@ class ImagesTest(utils.FixturedTestCase):
|
||||
il = self.cs.images.list()
|
||||
self.assert_called('GET', '/images/detail')
|
||||
[self.assertIsInstance(i, images.Image) for i in il]
|
||||
self.assertEqual(2, len(il))
|
||||
|
||||
def test_list_images_undetailed(self):
|
||||
il = self.cs.images.list(detailed=False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user