#NEWLINE# @ mock . patch ( 'nova.objects.MigrationList.get_in_progress_by_host_and_node' ) #NEWLINE# def test_deleted_instances_with_migrations( self , mock_migration_list ) : #NEWLINE# #INDENT# migration = objects . Migration ( context = self . context , migration_type = 'resize' , instance_uuid = 'invalid' ) #NEWLINE# mock_migration_list . return_value = [ migration ] #NEWLINE# self . tracker . update_available_resource ( self . context ) #NEWLINE# self . assertEqual ( 0 , self . tracker . compute_node . memory_mb_used ) #NEWLINE# self . assertEqual ( 0 , self . tracker . compute_node . local_gb_used ) #NEWLINE# mock_migration_list . assert_called_once_with ( self . context , 'fakehost' , 'fakenode' )