def SMTP(self, server):
        self.server = server
        if self.flag == 1:
            raise MockGaierror('gaierror')
        return MockSMTP('server')
Mock SMTP method
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/smtp_test.py/MockSmtplib.SMTP