#NEWLINE# def test_multiple_valid_readers( self ) : #NEWLINE# #INDENT# 'Test if the fixture works fine if there are multiple readers\n        capable of reading the file properly' #NEWLINE# open_dummy = SourceMetadata ( id = 'DummyFile' , class_name = 'mayavi.tests.test_registry.DummyReader' , menu_name = '&PLOT3D file' , tooltip = 'Open a PLOT3D data data' , desc = 'Open a PLOT3D data data' , help = 'Open a PLOT3D data data' , extensions = [ 'xyz' ] , wildcard = 'PLOT3D files (*.xyz)|*.xyz' , can_read_test = 'mayavi.tests.test_registry:DummyReader.check_read' , output_info = PipelineInfo ( datasets = [ 'structured_grid' ] , attribute_types = [ 'any' ] , attributes = [ 'any' ] ) ) #NEWLINE# registry . sources . append ( open_dummy ) #NEWLINE# reader = registry . get_file_reader ( get_example_data ( 'tiny.xyz' ) ) #NEWLINE# callable = reader . get_callable ( ) #NEWLINE# self . assertEqual ( callable . __name__ , 'PLOT3DReader' ) #NEWLINE# remove = [ ] #NEWLINE# for ( index , src ) in enumerate ( registry . sources [ : ] ) : #NEWLINE# #INDENT# if ( ( 'xyz' in src . extensions ) and ( src . id != 'DummyFile' ) ) : #NEWLINE# #INDENT# remove . append ( ( index , src ) ) #NEWLINE# registry . sources . remove ( src ) #NEWLINE# #UNINDENT# #UNINDENT# reader = registry . get_file_reader ( get_example_data ( 'tiny.xyz' ) ) #NEWLINE# callable = reader . get_callable ( ) #NEWLINE# self . assertEqual ( callable . __name__ , 'DummyReader' ) #NEWLINE# for ( index , src ) in remove : #NEWLINE# #INDENT# registry . sources . insert ( index , src ) #NEWLINE# #UNINDENT# registry . sources . remove ( open_dummy )