#NEWLINE# @ mock . patch . multiple ( systemconfig , SCDynamicStoreCreate = mock . DEFAULT , NSMutableDictionary = mock . DEFAULT , SCDynamicStoreSetValue = mock . DEFAULT ) #NEWLINE# @ mock . patch . object ( systemconfig . SCDynamicPreferences , 'ReadProxySettings' ) #NEWLINE# def testSetProxyEnable( self , mock_rps , **mocks ) : #NEWLINE# #INDENT# 'Test SCDynamicPreferences SetProxy, enable proxy.' #NEWLINE# enable = True #NEWLINE# pac = 'pac' #NEWLINE# proxy = 'proxy settings' #NEWLINE# mocks [ 'SCDynamicStoreCreate' ] . return_value = 'store' #NEWLINE# mock_rps . return_value = proxy #NEWLINE# proxies = { #NEWLINE# #INDENT# 'ProxyAutoConfigURLString' : pac , #NEWLINE# 'ProxyAutoConfigEnable' : 1 , #NEWLINE# #UNINDENT# } #NEWLINE# mocks [ 'NSMutableDictionary' ] . dictionaryWithDictionary_ . return_value = proxies #NEWLINE# mocks [ 'SCDynamicStoreSetValue' ] . return_value = 'foo' #NEWLINE# scdp = systemconfig . SCDynamicPreferences ( ) #NEWLINE# self . assertEqual ( scdp . SetProxy ( self , pac ) , 'foo' )