Add marker option for get_instance_list()

Change-Id: Iee31369876052a22e5f3263cd5e7fad5d068f68d
This commit is contained in:
chenke
2019-07-10 13:59:19 +08:00
parent 46cc09f00e
commit 502ed741d6
2 changed files with 7 additions and 5 deletions

View File

@@ -167,14 +167,14 @@ class TestNovaHelper(base.TestCase):
with mock.patch.object(nova_util, 'nova') as nova_mock:
result = nova_util.get_instance_list()
nova_mock.servers.list.assert_called_once_with(
search_opts={'all_tenants': True}, limit=-1)
search_opts={'all_tenants': True}, marker=None, limit=-1)
self.assertIs(result, nova_mock.servers.list.return_value)
# Call it again with filters.
with mock.patch.object(nova_util, 'nova') as nova_mock:
result = nova_util.get_instance_list(filters={'host': 'fake-host'})
nova_mock.servers.list.assert_called_once_with(
search_opts={'all_tenants': True, 'host': 'fake-host'},
limit=-1)
marker=None, limit=-1)
self.assertIs(result, nova_mock.servers.list.return_value)
@mock.patch.object(time, 'sleep', mock.Mock())