User FakeFlavor in TestServerResize.
Change-Id: Iac9b4583befaa4eb79ec59c39b97c613884ef2f7 Implements: blueprint improve-flavor-unit-test
This commit is contained in:
parent
db516b2c96
commit
c5a55d1370
@ -666,11 +666,8 @@ class TestServerResize(TestServer):
|
|||||||
self.servers_mock.revert_resize.return_value = None
|
self.servers_mock.revert_resize.return_value = None
|
||||||
|
|
||||||
# This is the return value for utils.find_resource()
|
# This is the return value for utils.find_resource()
|
||||||
self.flavors_get_return_value = fakes.FakeResource(
|
self.flavors_get_return_value = \
|
||||||
None,
|
compute_fakes.FakeFlavor.create_one_flavor()
|
||||||
copy.deepcopy(compute_fakes.FLAVOR),
|
|
||||||
loaded=True,
|
|
||||||
)
|
|
||||||
self.flavors_mock.get.return_value = self.flavors_get_return_value
|
self.flavors_mock.get.return_value = self.flavors_get_return_value
|
||||||
|
|
||||||
# Get the command object to test
|
# Get the command object to test
|
||||||
@ -700,11 +697,11 @@ class TestServerResize(TestServer):
|
|||||||
|
|
||||||
def test_server_resize(self):
|
def test_server_resize(self):
|
||||||
arglist = [
|
arglist = [
|
||||||
'--flavor', compute_fakes.flavor_id,
|
'--flavor', self.flavors_get_return_value.id,
|
||||||
self.server.id,
|
self.server.id,
|
||||||
]
|
]
|
||||||
verifylist = [
|
verifylist = [
|
||||||
('flavor', compute_fakes.flavor_id),
|
('flavor', self.flavors_get_return_value.id),
|
||||||
('confirm', False),
|
('confirm', False),
|
||||||
('revert', False),
|
('revert', False),
|
||||||
('server', self.server.id),
|
('server', self.server.id),
|
||||||
@ -718,7 +715,7 @@ class TestServerResize(TestServer):
|
|||||||
self.server.id,
|
self.server.id,
|
||||||
)
|
)
|
||||||
self.flavors_mock.get.assert_called_with(
|
self.flavors_mock.get.assert_called_with(
|
||||||
compute_fakes.flavor_id,
|
self.flavors_get_return_value.id,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.servers_mock.resize.assert_called_with(
|
self.servers_mock.resize.assert_called_with(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user