#NEWLINE# @ patch . object ( Collector , 'publish' ) #NEWLINE# def test_should_work_with_real_data( self , publish_mock ) : #NEWLINE# #INDENT# urlopen_mock = patch ( 'urllib2.urlopen' , Mock ( return_value = self . getFixture ( 'stats.json' ) ) ) #NEWLINE# urlopen_mock . start ( ) #NEWLINE# self . collector . collect ( ) #NEWLINE# urlopen_mock . stop ( ) #NEWLINE# metrics = self . getPickledResults ( 'real_stat.pkl' ) #NEWLINE# self . assertPublishedMany ( publish_mock , urlopen_mock )