#NEWLINE# def test_guess_layer_class( ) : #NEWLINE# #INDENT# ' Test layer type inferred correctly from filename\n    ' #NEWLINE# test_vectors = [ ( None , 'unknown' ) , ( 'NCDRILL.TXT' , 'unknown' ) , ( 'example_board.gtl' , 'top' ) , ( 'exampmle_board.sst' , 'topsilk' ) , ( 'ipc-d-356.ipc' , 'ipc_netlist' ) ] #NEWLINE# for hint in hints : #NEWLINE# #INDENT# for ext in hint . ext : #NEWLINE# #INDENT# assert_equal ( hint . layer , guess_layer_class ( 'board.{}' . format ( filename ) ) ) #NEWLINE# #UNINDENT# for name in hint . name : #NEWLINE# #INDENT# assert_equal ( hint . layer , guess_layer_class ( '{}.pho' . format ( name ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# for ( filename , layer_class ) in test_vectors : #NEWLINE# #INDENT# assert_equal ( layer_class , guess_layer_class ( filename ) )