def test_removes_https_proxy_from_environment(self):
https_proxy = factory.make_name("https-proxy")
initial = EnvironmentVariable("https_proxy", https_proxy)
self.useFixture(initial)
# On entry, https_proxy is removed from the environment.
with ProxiesDisabledFixture():
self.assertNotIn("https_proxy", os.environ)
# On exit, http_proxy is restored.
self.assertEqual(https_proxy, os.environ.get("https_proxy"))
评论列表
文章目录