#NEWLINE# def test__message_received_interceptor_exception( self ) : #NEWLINE# #INDENT# e = RPCResponseEndpointUnit ( routing_obj = self ) #NEWLINE# e . send = Mock ( ) #NEWLINE# e . send . return_value = sentinel . sent #NEWLINE# e . channel = Mock ( ) #NEWLINE# with patch ( 'pyon.net.endpoint.ResponseEndpointUnit._message_received' , new = Mock ( side_effect = exception . IonException ) ) : #NEWLINE# #INDENT# retval = e . _message_received ( sentinel . msg , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEquals ( retval , sentinel . sent ) #NEWLINE# assert_called_once_with_header ( self , e . send , { #NEWLINE# #INDENT# 'status_code' : ( - 1 ) , #NEWLINE# 'error_message' : '' , #NEWLINE# 'conv-id' : '' , #NEWLINE# 'conv-seq' : 2 , #NEWLINE# 'protocol' : '' , #NEWLINE# 'performative' : 'failure' , #NEWLINE# #UNINDENT# } )