#NEWLINE# @ run_only_if_gearman_is_available #NEWLINE# @ patch ( 'gearman.GearmanAdminClient' ) #NEWLINE# @ patch . object ( Collector , 'publish' ) #NEWLINE# def test_fail_gracefully( self , publish_mock , gearman_mock ) : #NEWLINE# #INDENT# client = Mock ( ) #NEWLINE# gearman_mock . return_value = gearman_mock #NEWLINE# client . ping_server . side_effect = IOError ( ) #NEWLINE# self . collector . collect ( ) #NEWLINE# self . assertPublishedMany ( publish_mock , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } )