#NEWLINE# def test_attempt_force_mx( self ) : #NEWLINE# #INDENT# env = Envelope ( 'sender@example.com' , [ 'rcpt@example.com' ] ) #NEWLINE# mx = MxSmtpRelay ( ) #NEWLINE# static = self . mox . CreateMock ( StaticSmtpRelay ) #NEWLINE# self . mox . StubOutWithMock ( mx , 'new_static_relay' ) #NEWLINE# mx . new_static_relay ( 'mail.example.com' , 25 ) . AndReturn ( static ) #NEWLINE# static . attempt ( env , 0 ) #NEWLINE# static . attempt ( env , 1 ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# mx . force_mx ( 'example.com' , 'mail.example.com' ) #NEWLINE# mx . attempt ( env , 0 ) #NEWLINE# mx . attempt ( static , 1 )