#NEWLINE# @ mock . patch . object ( db , 'block_device_mapping_get_all_by_volume_id' ) #NEWLINE# def test_get_by_volume_id_not_found( self , get_by_vol_id ) : #NEWLINE# #INDENT# get_by_vol_id . return_value = None #NEWLINE# self . assertRaises ( exception . VolumeBDMNotFound , objects . BlockDeviceMapping . get_by_volume_id , get_by_vol_id . context , 'fake-volume-id' )