#NEWLINE# def test_attempt_no_mx( self ) : #NEWLINE# #INDENT# env = Envelope ( 'sender@example.com' , [ 'rcpt@example.com' ] ) #NEWLINE# a_ret = FakeAAnswer ( False , [ ( '1.2.3.4' , ) ] ) #NEWLINE# mx = MxSmtpRelay ( ) #NEWLINE# static = self . mox . CreateMock ( StaticSmtpRelay ) #NEWLINE# self . mox . StubOutWithMock ( mx , 'new_static_relay' ) #NEWLINE# self . mox . StubOutWithMock ( DNSResolver , 'query' ) #NEWLINE# DNSResolver . query ( 'example.com' , 'MX' ) . AndRaise ( DNSError ( ARES_ENOTFOUND ) ) #NEWLINE# DNSResolver . query ( 'example.com' , 'A' ) . AndReturn ( FakeAsyncResult ( a_ret ) ) #NEWLINE# mx . new_static_relay ( '1.2.3.4' , 25 ) . AndReturn ( static ) #NEWLINE# static . attempt ( env , 0 ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# mx . attempt ( env , 0 )