#NEWLINE# def test_message_to_dict( self ) : #NEWLINE# #INDENT# body = b'Hello World' #NEWLINE# properties = { #NEWLINE# #INDENT# 'key' : 'value' , #NEWLINE# #UNINDENT# } #NEWLINE# method = { #NEWLINE# #INDENT# b'alternative' : 'value' , #NEWLINE# #UNINDENT# } #NEWLINE# message = Message ( body = body , properties = self , method = method , channel = None ) #NEWLINE# result = message . to_dict ( ) #NEWLINE# self . assertIsInstance ( result , dict ) #NEWLINE# self . assertEqual ( result [ 'body' ] , body ) #NEWLINE# self . assertEqual ( result [ 'properties' ] , properties ) #NEWLINE# self . assertEqual ( result [ 'method' ] , method )