#NEWLINE# def testMacroCleaners( self ) : #NEWLINE# #INDENT# dummyplugin = DummyPlugin ( ) #NEWLINE# plugins = dict ( dummy = dict ( get_macro_cleaners = dummyplugin . get_macro_cleaners ) ) #NEWLINE# def cleaner( macro ) : #NEWLINE# #INDENT# if ( 'cleanvalue' in macro ) : #NEWLINE# #INDENT# del macro [ 'cleanvalue' ] #NEWLINE# #UNINDENT# #UNINDENT# dummyplugin . macro_cleaners = { #NEWLINE# #INDENT# 'global' : cleaner , #NEWLINE# #UNINDENT# } #NEWLINE# contents = StringIO ( '\n' . join ( [ '[group:macro]' , 'macrovalue=1' , 'cleanvalue=3' , '[baz]' , '<=group:macro' , 'bazvalue=2' ] ) ) #NEWLINE# config = Config ( contents , plugins = plugins ) . parse ( ) #NEWLINE# assert ( config == { #NEWLINE# #INDENT# 'global' : { #NEWLINE# #INDENT# 'baz' : { #NEWLINE# #INDENT# 'macrovalue' : '1' , #NEWLINE# 'bazvalue' : '2' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# 'group' : { #NEWLINE# #INDENT# 'macro' : { #NEWLINE# #INDENT# 'macrovalue' : '1' , #NEWLINE# 'cleanvalue' : '3' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } )