Пример #1
0
 def testAllPropertiesSetInGcloud(self):
   SET_PROXY(proxy_type='http', address='golden', port='80',
             username='******', password='******')
   proxy_info, from_gcloud = http_proxy_setup.EffectiveProxyInfo()
   self.assertIsNotNone(proxy_info)
   self.assertTrue(from_gcloud)
   http_proxy_setup._DisplayGcloudProxyInfo(proxy_info, from_gcloud)
   self.AssertErrEquals(textwrap.dedent("""\
       Current effective Cloud SDK network proxy settings:
           type = http
           host = golden
           port = 80
           username = username
           password = password
       """) + '\n')
Пример #2
0
 def testNoGcloudPropertiesProxyInEnvironmentVars(self):
   self.StartEnvPatch(
       {'http_proxy': 'https://*****:*****@badproxy:8080',
        'https_proxy': 'https://*****:*****@badproxy:8081'})
   proxy_info, from_gcloud = http_proxy_setup.EffectiveProxyInfo()
   self.assertIsNotNone(proxy_info)
   self.assertFalse(from_gcloud)
   http_proxy_setup._DisplayGcloudProxyInfo(proxy_info, from_gcloud)
   self.AssertErrEquals(textwrap.dedent("""\
       Current effective Cloud SDK network proxy settings:
       (These settings are from your machine's environment, not gcloud properties.)
           type = http
           host = badproxy
           port = 8081
           username = baduser
           password = badpassword
       """) + '\n')
Пример #3
0
 def testNoGcloudPropertiesNoProxyInEnvironmentVars(self):
     proxy_info, from_gcloud = http_proxy_setup.EffectiveProxyInfo()
     self.assertIsNone(proxy_info)
     self.assertFalse(from_gcloud)
     http_proxy_setup._DisplayGcloudProxyInfo(proxy_info, from_gcloud)
     self.AssertErrEquals('\n')