#NEWLINE# def test_mixin( self ) : #NEWLINE# #INDENT# class T ( NoNewAttributesMixin ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# t = T ( ) #NEWLINE# self . assertFalse ( hasattr ( t , '__frozen' ) ) #NEWLINE# t . a = 'test' #NEWLINE# self . assertEqual ( t . a , 'test' ) #NEWLINE# t . _freeze ( ) #NEWLINE# self . assertIs ( getattr ( t , '__frozen' ) , True ) #NEWLINE# def f( ) : #NEWLINE# #INDENT# t . b = 'test' #NEWLINE# #UNINDENT# self . assertRaises ( AttributeError , f ) #NEWLINE# self . assertFalse ( hasattr ( t , 'b' ) )