Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_urllib.ProxyTests Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def test_getproxies_environment_keep_no_proxies

Public Attributes


Detailed Description

Definition at line 118 of file

Member Function Documentation

Definition at line 120 of file

00121     def setUp(self):
00122         # Records changes to env vars
00123         self.env = support.EnvironmentVarGuard()
00124         # Delete all proxy related env vars
00125         for k in list(os.environ):
00126             if 'proxy' in k.lower():
00127                 self.env.unset(k)

Here is the caller graph for this function:

Definition at line 128 of file

00129     def tearDown(self):
00130         # Restore all proxy related env vars
00131         self.env.__exit__()
00132         del self.env

Here is the caller graph for this function:

Definition at line 133 of file

00134     def test_getproxies_environment_keep_no_proxies(self):
00135         self.env.set('NO_PROXY', 'localhost')
00136         proxies = urllib.request.getproxies_environment()
00137         # getproxies_environment use lowered case truncated (no '_proxy') keys
00138         self.assertEqual('localhost', proxies['no'])
00139         # List of no_proxies with space.
00140         self.env.set('NO_PROXY', 'localhost,,')
00141         self.assertTrue(urllib.request.proxy_bypass_environment(''))

Here is the call graph for this function:

Member Data Documentation

Definition at line 122 of file

The documentation for this class was generated from the following file: