#NEWLINE# def test_preserve_attributes( self ) : #NEWLINE# #INDENT# @ myattr_dec #NEWLINE# @ myattr2_dec #NEWLINE# def func( ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# self . assertEqual ( getattr ( func , 'myattr' , False ) , True ) #NEWLINE# self . assertEqual ( getattr ( func , 'myattr2' , False ) , True ) #NEWLINE# class Test ( object ) : #NEWLINE# #INDENT# @ myattr_dec_m #NEWLINE# @ myattr2_dec_m #NEWLINE# def method( self ) : #NEWLINE# #INDENT# 'A method' #NEWLINE# pass #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( getattr ( Test ( ) . method , 'myattr' , False ) , True ) #NEWLINE# self . assertEqual ( getattr ( Test ( ) . method , 'myattr2' , False ) , True ) #NEWLINE# self . assertEqual ( getattr ( Test . method , 'myattr' , False ) , True ) #NEWLINE# self . assertEqual ( getattr ( Test . method , 'myattr2' , False ) , True ) #NEWLINE# self . assertEqual ( Test . method . __doc__ , 'A method' ) #NEWLINE# self . assertEqual ( Test . method . im_func . __name__ , 'method' )