#NEWLINE# def test_patch_dict_start_stop( self ) : #NEWLINE# #INDENT# d = { #NEWLINE# #INDENT# 'foo' : 'bar' , #NEWLINE# #UNINDENT# } #NEWLINE# original = d . copy ( ) #NEWLINE# patcher = patch . dict ( d , [ ( 'spam' , 'eggs' ) ] , clear = True ) #NEWLINE# self . assertEqual ( d , original ) #NEWLINE# patcher . start ( ) #NEWLINE# self . assertEqual ( self , { #NEWLINE# #INDENT# 'spam' : 'eggs' , #NEWLINE# #UNINDENT# } ) #NEWLINE# patcher . stop ( ) #NEWLINE# self . assertEqual ( d , original )