Merge "Fix tests to correctly call reset_mock()"
This commit is contained in:
commit
bc92de786c
@ -1413,7 +1413,7 @@ class TestControllerWorker(base.TestCase):
|
|||||||
mock_update.assert_called_with(_db_session, '123',
|
mock_update.assert_called_with(_db_session, '123',
|
||||||
provisioning_status=constants.ACTIVE)
|
provisioning_status=constants.ACTIVE)
|
||||||
|
|
||||||
mock_perform.reset
|
mock_perform.reset_mock()
|
||||||
_load_balancer_mock.amphorae = [
|
_load_balancer_mock.amphorae = [
|
||||||
_amphora_mock, _amphora_mock2, _amphora_mock3]
|
_amphora_mock, _amphora_mock2, _amphora_mock3]
|
||||||
_amphora_mock2.role = constants.ROLE_BACKUP
|
_amphora_mock2.role = constants.ROLE_BACKUP
|
||||||
@ -1425,7 +1425,7 @@ class TestControllerWorker(base.TestCase):
|
|||||||
mock_update.assert_called_with(_db_session, '123',
|
mock_update.assert_called_with(_db_session, '123',
|
||||||
provisioning_status=constants.ACTIVE)
|
provisioning_status=constants.ACTIVE)
|
||||||
|
|
||||||
mock_perform.reset
|
mock_perform.reset_mock()
|
||||||
mock_perform.side_effect = OverflowError()
|
mock_perform.side_effect = OverflowError()
|
||||||
self.assertRaises(OverflowError, cw.failover_loadbalancer, 123)
|
self.assertRaises(OverflowError, cw.failover_loadbalancer, 123)
|
||||||
mock_update.assert_called_with(_db_session, 123,
|
mock_update.assert_called_with(_db_session, 123,
|
||||||
|
@ -1466,7 +1466,7 @@ class TestControllerWorker(base.TestCase):
|
|||||||
mock_update.assert_called_with(_db_session, '123',
|
mock_update.assert_called_with(_db_session, '123',
|
||||||
provisioning_status=constants.ACTIVE)
|
provisioning_status=constants.ACTIVE)
|
||||||
|
|
||||||
mock_perform.reset
|
mock_perform.reset_mock()
|
||||||
_load_balancer_mock.amphorae = [
|
_load_balancer_mock.amphorae = [
|
||||||
_amphora_mock, _amphora_mock2, _amphora_mock3]
|
_amphora_mock, _amphora_mock2, _amphora_mock3]
|
||||||
_amphora_mock2.role = constants.ROLE_BACKUP
|
_amphora_mock2.role = constants.ROLE_BACKUP
|
||||||
@ -1478,7 +1478,7 @@ class TestControllerWorker(base.TestCase):
|
|||||||
mock_update.assert_called_with(_db_session, '123',
|
mock_update.assert_called_with(_db_session, '123',
|
||||||
provisioning_status=constants.ACTIVE)
|
provisioning_status=constants.ACTIVE)
|
||||||
|
|
||||||
mock_perform.reset
|
mock_perform.reset_mock()
|
||||||
mock_perform.side_effect = OverflowError()
|
mock_perform.side_effect = OverflowError()
|
||||||
self.assertRaises(OverflowError, cw.failover_loadbalancer, 123)
|
self.assertRaises(OverflowError, cw.failover_loadbalancer, 123)
|
||||||
mock_update.assert_called_with(_db_session, 123,
|
mock_update.assert_called_with(_db_session, 123,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user