#NEWLINE# @ mock . patch . object ( db , 'block_device_mapping_get_all_by_instance' ) #NEWLINE# def test_root_bdm_undefined( self , get_all_by_inst ) : #NEWLINE# #INDENT# fakes = [ self . fake_bdm ( 123 , instance_uuid = 'uuid_1' ) , self . fake_bdm ( 456 , instance_uuid = 'uuid_2' ) ] #NEWLINE# get_all_by_inst . return_value = fakes #NEWLINE# bdm_list = objects . BlockDeviceMappingList . get_by_instance_uuid ( self . context , 'fake-instance' ) #NEWLINE# self . assertRaises ( exception . UndefinedRootBDM , bdm_list . root_bdm )