#NEWLINE# @ mock . patch ( '__builtin__.print' ) #NEWLINE# def test_command_show_info( self , mock_print ) : #NEWLINE# #INDENT# metadata = { #NEWLINE# #INDENT# 'targets' : 'target_desc' , #NEWLINE# 'authors' : 'authors_desc' , #NEWLINE# 'references' : 'references_desc' , #NEWLINE# 'description' : 'description_desc' , #NEWLINE# 'name' : 'name_desc' , #NEWLINE# #UNINDENT# } #NEWLINE# description = 'Elaborate description fo the module' #NEWLINE# self . interpreter . current_module . __doc__ = description #NEWLINE# self . interpreter . current_module . _MagicMock__info__ = metadata #NEWLINE# self . interpreter . command_show ( 'info' ) #NEWLINE# self . assertEqual ( mock_print . mock_calls , [ mock . call ( '\nName:' ) , mock . call ( 'name_desc' ) , mock . call ( '\nDescription:' ) , mock . call ( 'description_desc' ) , mock . call ( '\nTargets:' ) , mock . call ( 'target_desc' ) , mock . call ( '\nAuthors:' ) , mock . call ( 'authors_desc' ) , mock . call ( '\nReferences:' ) , mock . call ( 'references_desc' ) , mock . call ( ) ] )