#NEWLINE# def test_patch_multiple( self ) : #NEWLINE# #INDENT# original_foo = Foo #NEWLINE# original_f = Foo . f #NEWLINE# original_g = Foo . g #NEWLINE# patcher1 = patch . multiple ( foo_name , f = 1 , g = 2 ) #NEWLINE# patcher2 = patch . multiple ( Foo , f = 1 , g = 2 ) #NEWLINE# for patcher in ( patcher1 , patcher2 ) : #NEWLINE# #INDENT# patcher . start ( ) #NEWLINE# try : #NEWLINE# #INDENT# self . assertIs ( Foo , original_foo ) #NEWLINE# self . assertEqual ( Foo . f , 1 ) #NEWLINE# self . assertEqual ( Foo . g , 2 ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# patcher . stop ( ) #NEWLINE# #UNINDENT# self . assertIs ( Foo , original_foo ) #NEWLINE# self . assertEqual ( Foo . f , original_f ) #NEWLINE# self . assertEqual ( Foo . g , original_g ) #NEWLINE# #UNINDENT# @ patch . multiple ( foo_name , f = 3 , g = 4 ) #NEWLINE# def test( ) : #NEWLINE# #INDENT# self . assertIs ( Foo , original_foo ) #NEWLINE# self . assertEqual ( Foo . f , 3 ) #NEWLINE# self . assertEqual ( Foo . g , 4 ) #NEWLINE# #UNINDENT# test ( )