#NEWLINE# def test_rename_strict( ) : #NEWLINE# #INDENT# table = ( ( 'foo' , 'bar' ) , ( 'M' , 12 ) , ( 'F' , 34 ) , ( '-' , 56 ) ) #NEWLINE# result = rename ( table , 'baz' , 'quux' ) #NEWLINE# try : #NEWLINE# #INDENT# fieldnames ( result ) #NEWLINE# #UNINDENT# except FieldSelectionError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert False , 'exception expected' #NEWLINE# #UNINDENT# result = rename ( table , 2 , 'quux' ) #NEWLINE# try : #NEWLINE# #INDENT# fieldnames ( result ) #NEWLINE# #UNINDENT# except FieldSelectionError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert False , 'exception expected' #NEWLINE# #UNINDENT# result = rename ( table , 'baz' , 'quux' , strict = False ) #NEWLINE# assert ( fieldnames ( result ) == ( 'foo' , 'bar' ) ) #NEWLINE# result = rename ( table , 2 , 'quux' , strict = False ) #NEWLINE# assert ( fieldnames ( result ) == ( 'foo' , 'bar' ) )