#NEWLINE# @ patch ( 'os.access' , Mock ( return_value = True ) ) #NEWLINE# def test_get_disk_statistics( self ) : #NEWLINE# #INDENT# patch_open = patch ( '__builtin__.open' , Mock ( return_value = self . getFixture ( 'diskstats' ) ) ) #NEWLINE# open_mock = patch_open . start ( ) #NEWLINE# result = self . collector . get_disk_statistics ( ) #NEWLINE# patch_open . stop ( ) #NEWLINE# open_mock . assert_called_once_with ( '/proc/diskstats' ) #NEWLINE# self . assertEqual ( sorted ( result . keys ( ) ) , [ ( 8 , 0 ) , ( 8 , 1 ) , ( 8 , 16 ) , ( 8 , 17 ) , ( 8 , 32 ) , ( 8 , 33 ) , ( 8 , 48 ) , ( 8 , 49 ) , ( 9 , 0 ) ] ) #NEWLINE# return result