#NEWLINE# def test_attempt_no_records( self ) : #NEWLINE# #INDENT# env = Envelope ( 'sender@example.com' , [ 'rcpt@example.com' ] ) #NEWLINE# mx = MxSmtpRelay ( ) #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' ) . AndRaise ( DNSError ( ARES_ENOTFOUND ) ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# with self . assertRaises ( PermanentRelayError ) : #NEWLINE# #INDENT# mx . attempt ( env , 0 )