#NEWLINE# def test_patch_multiple_create_mocks_patcher( self ) : #NEWLINE# #INDENT# original_foo = Foo #NEWLINE# original_f = Foo . f #NEWLINE# original_g = Foo . g #NEWLINE# patcher = patch . multiple ( foo_name , f = DEFAULT , g = 3 , foo = DEFAULT ) #NEWLINE# result = patcher . start ( ) #NEWLINE# try : #NEWLINE# #INDENT# f = result [ 'f' ] #NEWLINE# foo = result [ 'foo' ] #NEWLINE# self . assertEqual ( set ( result ) , set ( [ 'f' , 'foo' ] ) ) #NEWLINE# self . assertIs ( Foo , original_foo ) #NEWLINE# self . assertIs ( Foo . f , result ) #NEWLINE# self . assertIs ( Foo . foo , foo ) #NEWLINE# self . assertTrue ( is_instance ( f , MagicMock ) ) #NEWLINE# self . assertTrue ( is_instance ( foo , MagicMock ) ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# patcher . stop ( ) #NEWLINE# #UNINDENT# self . assertEqual ( Foo . f , original_f ) #NEWLINE# self . assertEqual ( Foo . g , original_g )