#NEWLINE# @ mock . patch . object ( volumeops . VolumeOps , 'get_mounted_disk_path_from_volume' ) #NEWLINE# def test_get_disk_path_mapping( self , mock_get_disk_path ) : #NEWLINE# #INDENT# block_device_info = get_fake_block_dev_info ( ) #NEWLINE# block_device_mapping = block_device_info [ 'block_device_mapping' ] #NEWLINE# fake_conn_info = get_fake_connection_info ( ) #NEWLINE# block_device_mapping [ 0 ] [ 'connection_info' ] = fake_conn_info #NEWLINE# mock_get_disk_path . return_value = mock . sentinel . disk_path #NEWLINE# resulted_disk_path_mapping = self . _volumeops . get_disk_path_mapping ( block_device_info ) #NEWLINE# mock_get_disk_path . assert_called_once_with ( fake_conn_info ) #NEWLINE# expected_disk_path_mapping = { #NEWLINE# #INDENT# mock . sentinel . serial : mock . sentinel . disk_path , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( expected_disk_path_mapping , expected_disk_path_mapping )