~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_merge_directive.py

  • Committer: Vincent Ladeuil
  • Date: 2007-10-23 07:15:13 UTC
  • mfrom: (2926 +trunk)
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071023071513-elryt6g2at34d2ur
merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
        connect_calls = []
117
117
        def connect(self, host='localhost', port=0):
118
118
            connect_calls.append((self, host, port))
119
 
        def starttls(self):
120
 
            pass
 
119
        def has_extn(self, extension):
 
120
            return False
 
121
        def ehlo(self):
 
122
            return (200, 'Ok')
121
123
        old_sendmail = smtplib.SMTP.sendmail
122
124
        smtplib.SMTP.sendmail = sendmail
123
125
        old_connect = smtplib.SMTP.connect
124
126
        smtplib.SMTP.connect = connect
125
 
        old_starttls = smtplib.SMTP.starttls
126
 
        smtplib.SMTP.starttls = starttls
 
127
        old_ehlo = smtplib.SMTP.ehlo
 
128
        smtplib.SMTP.ehlo = ehlo
 
129
        old_has_extn = smtplib.SMTP.has_extn
 
130
        smtplib.SMTP.has_extn = has_extn
127
131
        try:
128
132
            result = self.run_bzr(*args, **kwargs)
129
133
        finally:
130
134
            smtplib.SMTP.sendmail = old_sendmail
131
135
            smtplib.SMTP.connect = old_connect
132
 
            smtplib.SMTP.starttls = old_starttls
 
136
            smtplib.SMTP.ehlo = old_ehlo
 
137
            smtplib.SMTP.has_extn = old_has_extn
133
138
        return result + (connect_calls, sendmail_calls)
134
139
 
135
140
    def test_mail_default(self):