#NEWLINE# @ patch ( 'os.access' , Mock ( return_value = True ) ) #NEWLINE# @ patch . object ( Collector , 'publish' ) #NEWLINE# def test_verify_supporting_vda_and_xvdb( self , publish_mock ) : #NEWLINE# #INDENT# patch_open = patch ( '__builtin__.open' , Mock ( return_value = self . getFixture ( 'proc_diskstats_1_vda_xvdb' ) ) ) #NEWLINE# patch_time = patch ( 'time.time' , Mock ( return_value = 10 ) ) #NEWLINE# patch_open . start ( ) #NEWLINE# patch_time . start ( ) #NEWLINE# self . collector . collect ( ) #NEWLINE# patch_open . stop ( ) #NEWLINE# patch_time . stop ( ) #NEWLINE# self . assertPublishedMany ( publish_mock , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# patch_open = patch ( '__builtin__.open' , Mock ( return_value = self . getFixture ( 'proc_diskstats_2_vda_xvdb' ) ) ) #NEWLINE# patch_time = patch ( 'time.time' , Mock ( return_value = 20 ) ) #NEWLINE# patch_open . start ( ) #NEWLINE# patch_time . start ( ) #NEWLINE# self . collector . collect ( ) #NEWLINE# patch_open . stop ( ) #NEWLINE# patch_time . stop ( ) #NEWLINE# metrics = self . getPickledResults ( 'test_verify_supporting_vda_and_xvdb.pkl' ) #NEWLINE# self . assertPublishedMany ( publish_mock , metrics )