def test_shotgun_yml_empty_string_can_override_global_proxy(self, *_): """ Make sure that shotgun.yml can disable the system level proxy. """ instance = UserSettings._instance = Mock() instance.shotgun_proxy = None dm = CoreDefaultsManager() self.assertIs(dm.get_http_proxy(), "")
def test_shotgun_yml_no_proxy_uses_global_proxy(self, *unused_mocks): """ Make sure that no proxy in shogun.yml means proxy in shotgun.yml will be picked. """ instance = UserSettings._instance = Mock() instance.shotgun_proxy = self._CONFIG_HTTP_PROXY dm = CoreDefaultsManager() self.assertIs(dm.get_http_proxy(), self._CONFIG_HTTP_PROXY)
def test_toolkit_ini_disabling_global_proxy(self, *_): """ Make sure that toolkit.ini can disable the system level proxy. """ instance = UserSettings._instance = Mock() instance.shotgun_proxy = "" dm = CoreDefaultsManager() self.assertEqual(dm.get_http_proxy(), "")
def test_shotgun_yml_over_global(self, *unused_mocks): """ Make sure that shotgun.yml always overrides toolkit.ini """ instance = UserSettings._instance = Mock() instance.shotgun_proxy = self._CONFIG_HTTP_PROXY instance.default_site = self._CONFIG_HOST instance.default_login = self._CONFIG_USER dm = CoreDefaultsManager() self.assertEqual(dm.get_host(), self._SHOTGUN_YML_HOST) self.assertEqual(dm.get_login(), self._CONFIG_USER) self.assertIs(dm.get_http_proxy(), self._SHOTGUN_YML_PROXY)
def test_shotgun_yml_over_global(self, *unused_mocks): """ Make sure that shotgun.yml always overrides config.ini """ instance = UserSettings._instance = Mock() instance.shotgun_proxy = self._CONFIG_HTTP_PROXY instance.default_site = self._CONFIG_HOST instance.default_login = self._CONFIG_USER dm = CoreDefaultsManager() self.assertEqual(dm.get_host(), self._SHOTGUN_YML_HOST) self.assertEqual(dm.get_login(), self._CONFIG_USER) self.assertIs(dm.get_http_proxy(), self._SHOTGUN_YML_PROXY)