def pgl(): pgl_ = PgLookout("pglookout.json") pgl_.check_for_maintenance_mode_file = Mock() pgl_.check_for_maintenance_mode_file.return_value = False pgl_.cluster_monitor._connect_to_db = Mock() # pylint: disable=protected-access pgl_.create_alert_file = Mock() pgl_.execute_external_command = Mock() try: yield pgl_ finally: pgl_.quit()
def pgl(): pgl_ = PgLookout("pglookout.json") pgl_.config["remote_conns"] = {} pgl_.check_for_maintenance_mode_file = Mock() pgl_.check_for_maintenance_mode_file.return_value = False pgl_.cluster_monitor._connect_to_db = Mock() # pylint: disable=protected-access pgl_.create_alert_file = Mock() pgl_.execute_external_command = Mock() try: yield pgl_ finally: pgl_.quit()