#NEWLINE# @ mock . patch ( 'nova.compute.api.API._get_bdm_image_metadata' ) #NEWLINE# def test_create_instance_non_bootable_volume_fails( self , fake_bdm_meta ) : #NEWLINE# #INDENT# bdm = [ { #NEWLINE# #INDENT# 'volume_id' : self . volume_id , #NEWLINE# 'device_name' : 'vda' , #NEWLINE# #UNINDENT# } ] #NEWLINE# params = { #NEWLINE# #INDENT# 'block_device_mapping' : bdm , #NEWLINE# #UNINDENT# } #NEWLINE# fake_bdm_meta . side_effect = exception . InvalidBDMVolumeNotBootable ( id = 1 ) #NEWLINE# self . assertRaises ( exc . HTTPBadRequest , self . _test_create , bdm , no_image = True )