Enable setup_servers_mock() to take attributes param.
setup_servers_mock() is now able to set methods to the fake servers. But it cannot set attributes. This patch enable it to do so. This will be useful in "server list" test cases. Change-Id: Ic30d750ebe4650244707a368cdd5d622a8f1b8ed Implements: blueprint osc-unit-test-framework-improvement
This commit is contained in:
@ -53,11 +53,15 @@ class TestServer(compute_fakes.TestComputev2):
|
||||
self.volumes_mock = self.app.client_manager.volume.volumes
|
||||
self.volumes_mock.reset_mock()
|
||||
|
||||
# Set object attributes to be tested. Could be overwriten in subclass.
|
||||
self.attrs = {}
|
||||
|
||||
# Set object methods to be tested. Could be overwriten in subclass.
|
||||
self.methods = {}
|
||||
|
||||
def setup_servers_mock(self, count):
|
||||
servers = compute_fakes.FakeServer.create_servers(methods=self.methods,
|
||||
servers = compute_fakes.FakeServer.create_servers(attrs=self.attrs,
|
||||
methods=self.methods,
|
||||
count=count)
|
||||
|
||||
# This is the return value for utils.find_resource()
|
||||
|
Reference in New Issue
Block a user