@mock.patch.multiple(
      systemconfig, SCDynamicStoreCreate=mock.DEFAULT,
      NSMutableDictionary=mock.DEFAULT, SCDynamicStoreSetValue=mock.DEFAULT)
  @mock.patch.object(systemconfig.SCDynamicPreferences, 'ReadProxySettings')
  def testSetProxyEnable(self, mock_rps, **mocks):
    enable = True
    pac = 'pac'
    proxy = 'proxy settings'
    mocks['SCDynamicStoreCreate'].return_value = 'store'
    mock_rps.return_value = proxy
    proxies = {'ProxyAutoConfigURLString': pac, 'ProxyAutoConfigEnable': 1}
    mocks['NSMutableDictionary'].dictionaryWithDictionary_.return_value = proxies  # pylint: disable=line-too-long
    mocks['SCDynamicStoreSetValue'].return_value = 'foo'
    scdp = systemconfig.SCDynamicPreferences()
    self.assertEqual(scdp.SetProxy(enable, pac), 'foo')
Test SCDynamicPreferences SetProxy, enable proxy.
dataset/ETHPy150Open google/macops/gmacpyutil/gmacpyutil/systemconfig_test.py/SCDynamicPreferencesTest.testSetProxyEnable