def test_create_server_farm_1(self, mock_f1, mock_f2, mock_f3): """Exception""" cmd.create_server_farm(self.ctx, self.server_farm) rollback_fn = self.ctx.add_rollback.call_args[0][0] rollback_fn(False) self.assertTrue(mock_f1.called) mock_f1.assert_called_once_with(self.ctx, self.server_farm)
def test_create_server_farm_0(self, mock_f1, mock_f2, mock_f3): """No exception""" cmd.create_server_farm(self.ctx, self.server_farm) self.assertTrue(self.ctx.device.create_server_farm.called) self.assertTrue(mock_f2.called) self.assertFalse(mock_f1.called) self.assertTrue(mock_f3.called)
def test_create_server_farm_0(self, mock_f1, mock_f2, mock_f3): """No exception""" cmd.create_server_farm(self.ctx, self.server_farm) self.assertTrue(self.ctx.device.create_server_farm.called) self.assertFalse(mock_f1.called) self.assertTrue(mock_f2.called) self.assertTrue(mock_f3.called) mock_f2.assert_called_once_with(self.ctx.conf, self.server_farm['id'], {'deployed': True}) mock_f3.assert_called_once_with(self.ctx.conf, self.server_farm['id'])