#NEWLINE# def test_process_one_multiline( ) : #NEWLINE# #INDENT# '\n    Test we gracefully handle a message where the message file is split\n    over multiple lines. This means the stack trace is also the message.\n    We want to clip it so the message is only the first line of the\n    message.\n    ' #NEWLINE# message = { #NEWLINE# #INDENT# 'module' : 'log' , #NEWLINE# 'funcName' : 'log_exception' , #NEWLINE# 'message' : '1\n2\n3\n' , #NEWLINE# 'filename' : 'log.py' , #NEWLINE# 'lineno' : 214 , #NEWLINE# 'args' : [ ] , #NEWLINE# 'exc_text' : 'Traceback (most recent call last):' , #NEWLINE# 'kind' : 'app' , #NEWLINE# 'pathname' : '/some/path.py' , #NEWLINE# 'source' : 'eric-desktop' , #NEWLINE# #UNINDENT# } #NEWLINE# message_params = { k : v for ( k , v ) in message . items ( ) if ( k in UniqueMessage . _fields ) } #NEWLINE# message_params [ 'message' ] = '1' #NEWLINE# expected_message = _package_unique_message ( message_params ) #NEWLINE# message_queue = Mock ( ) #NEWLINE# message_queue . get . return_value = message #NEWLINE# message_buffer = Mock ( ) #NEWLINE# _process_one_message ( message_queue , message_buffer ) #NEWLINE# message_buffer . add . assert_called_once_with ( expected_message , message [ 'source' ] )