Fix incorrect use of mock in scheduler test

Fix a scheduler manager test that mocks a manager method, calls the
same method and then verifies it was called.

Instead mock the driver method that is called by it and test that the
manager method calls it.

Change-Id: Ic349e443c143b27d1cc4456b667223f350de2325
This commit is contained in:
Hans Lindgren
2015-02-07 16:33:13 +01:00
parent 45e4d3a574
commit 1bd3399232

View File

@@ -70,7 +70,7 @@ class SchedulerManagerTestCase(test.NoDBTestCase):
method_name)
def test_select_destination(self):
with mock.patch.object(self.manager, 'select_destinations'
with mock.patch.object(self.manager.driver, 'select_destinations'
) as select_destinations:
self.manager.select_destinations(None, None, {})
select_destinations.assert_called_once_with(None, None, {})