#NEWLINE# @ patch . object ( Collector , 'publish' ) #NEWLINE# def test_success( self , publish_mock ) : #NEWLINE# #INDENT# self . collector . getAllProcessInfo = Mock ( return_value = eval ( self . getFixture ( 'valid_fixture' ) . getvalue ( ) ) ) #NEWLINE# self . collector . collect ( ) #NEWLINE# metrics = { #NEWLINE# #INDENT# 'test_group.test_name_1.state' : 20 , #NEWLINE# 'test_group.test_name_1.uptime' : 5 , #NEWLINE# 'test_group.test_name_2.state' : 200 , #NEWLINE# 'test_group.test_name_2.uptime' : 500 , #NEWLINE# #UNINDENT# } #NEWLINE# self . setDocExample ( collector = self . collector . __class__ . __name__ , metrics = metrics , defaultpath = self . collector . config [ 'path' ] ) #NEWLINE# self . assertPublishedMany ( publish_mock , metrics )