Merge "Use FakeFlavor in TestServerCreate."

This commit is contained in:
Jenkins 2015-11-29 19:46:41 +00:00 committed by Gerrit Code Review
commit 691ca98006

View File

@ -110,11 +110,7 @@ class TestServerCreate(TestServer):
) )
self.cimages_mock.get.return_value = self.image self.cimages_mock.get.return_value = self.image
self.flavor = fakes.FakeResource( self.flavor = compute_fakes.FakeFlavor.create_one_flavor()
None,
copy.deepcopy(compute_fakes.FLAVOR),
loaded=True,
)
self.flavors_mock.get.return_value = self.flavor self.flavors_mock.get.return_value = self.flavor
self.volume = fakes.FakeResource( self.volume = fakes.FakeResource(
@ -192,7 +188,7 @@ class TestServerCreate(TestServer):
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
'', '',
'Large ()', self.flavor.name + ' ()',
self.new_server.id, self.new_server.id,
self.new_server.name, self.new_server.name,
self.new_server.networks, self.new_server.networks,
@ -276,7 +272,7 @@ class TestServerCreate(TestServer):
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
'', '',
'Large ()', self.flavor.name + ' ()',
self.new_server.id, self.new_server.id,
self.new_server.name, self.new_server.name,
self.new_server.networks, self.new_server.networks,
@ -349,7 +345,7 @@ class TestServerCreate(TestServer):
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
'', '',
'Large ()', self.flavor.name + ' ()',
self.new_server.id, self.new_server.id,
self.new_server.name, self.new_server.name,
self.new_server.networks, self.new_server.networks,
@ -360,13 +356,13 @@ class TestServerCreate(TestServer):
def test_server_create_with_block_device_mapping(self): def test_server_create_with_block_device_mapping(self):
arglist = [ arglist = [
'--image', 'image1', '--image', 'image1',
'--flavor', compute_fakes.flavor_id, '--flavor', self.flavor.id,
'--block-device-mapping', compute_fakes.block_device_mapping, '--block-device-mapping', compute_fakes.block_device_mapping,
self.new_server.name, self.new_server.name,
] ]
verifylist = [ verifylist = [
('image', 'image1'), ('image', 'image1'),
('flavor', compute_fakes.flavor_id), ('flavor', self.flavor.id),
('block_device_mapping', [compute_fakes.block_device_mapping]), ('block_device_mapping', [compute_fakes.block_device_mapping]),
('config_drive', False), ('config_drive', False),
('server_name', self.new_server.name), ('server_name', self.new_server.name),
@ -418,7 +414,7 @@ class TestServerCreate(TestServer):
self.assertEqual(collist, columns) self.assertEqual(collist, columns)
datalist = ( datalist = (
'', '',
'Large ()', self.flavor.name + ' ()',
self.new_server.id, self.new_server.id,
self.new_server.name, self.new_server.name,
self.new_server.networks, self.new_server.networks,