#NEWLINE# @ mock . patch . object ( vmops . VMOps , '_attach_drive' ) #NEWLINE# def test_attach_root_device_disk( self , mock_attach_drive ) : #NEWLINE# #INDENT# mock_instance = fake_instance . fake_instance_obj ( self . context ) #NEWLINE# root_device_info = { #NEWLINE# #INDENT# 'type' : constants . DISK , #NEWLINE# 'boot_index' : 0 , #NEWLINE# 'disk_bus' : constants . CTRL_TYPE_IDE , #NEWLINE# 'path' : 'fake_path' , #NEWLINE# 'drive_addr' : 0 , #NEWLINE# 'ctrl_disk_addr' : 1 , #NEWLINE# #UNINDENT# } #NEWLINE# self . _vmops . _attach_root_device ( mock_instance . name , root_device_info ) #NEWLINE# mock_attach_drive . assert_called_once_with ( mock_instance . name , root_device_info [ 'path' ] , root_device_info [ 'drive_addr' ] , root_device_info [ 'ctrl_disk_addr' ] , root_device_info [ 'disk_bus' ] , root_device_info [ 'type' ] )