def test_email_alerts(self): ''' Test to Enable/Disable email alerts ''' mock = MagicMock(return_value=True) with patch.object(drac, '__execute_cmd', mock): self.assertTrue(drac.email_alerts(True)) mock = MagicMock(return_value=True) with patch.object(drac, '__execute_cmd', mock): self.assertTrue(drac.email_alerts(False))