#NEWLINE# @ patch ( 'diamond.collector.Collector.publish' ) #NEWLINE# def test_should_work_with_real_data( self , publish_mock ) : #NEWLINE# #INDENT# self . setUp ( [ 'ListenOverflows' , 'ListenDrops' , 'TCPLoss' , 'TCPTimeouts' ] ) #NEWLINE# TCPCollector . PROC = [ self . getFixturePath ( 'proc_net_netstat_1' ) ] #NEWLINE# self . collector . collect ( ) #NEWLINE# self . assertPublishedMany ( publish_mock , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# TCPCollector . PROC = [ self . getFixturePath ( 'proc_net_netstat_2' ) ] #NEWLINE# self . collector . collect ( ) #NEWLINE# metrics = { #NEWLINE# #INDENT# 'ListenOverflows' : 0 , #NEWLINE# 'ListenDrops' : 0 , #NEWLINE# 'TCPLoss' : 188 , #NEWLINE# 'TCPTimeouts' : 15265 , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertPublishedMany ( publish_mock , metrics )