Beispiel #1
0
 def test_in_path(self):
     if sys.platform != 'win32':
         raise TestSkipped('Searching in PATH implemented only for win32')
     os.mkdir('foo')
     in_dir = os.path.join(os.getcwd(), 'foo')
     self._make_file(in_dir=in_dir)
     self.overrideEnv('PATH', in_dir)
     shouldbe = os.path.join(in_dir, 'curl-ca-bundle.crt')
     self.assertEqual(shouldbe, ca_bundle.get_ca_path(use_cache=False))
Beispiel #2
0
 def __init__(self, base, _from_transport=None):
     super(PyCurlTransport, self).__init__(base,
                                           _from_transport=_from_transport)
     if base.startswith('https'):
         # Check availability of https into pycurl supported
         # protocols
         supported = pycurl.version_info()[8]
         if 'https' not in supported:
             raise errors.DependencyNotPresent('pycurl', 'no https support')
     self.cabundle = ca_bundle.get_ca_path()
Beispiel #3
0
 def __init__(self, base, _from_transport=None):
     super(PyCurlTransport, self).__init__(base,
                                           'pycurl',
                                           _from_transport=_from_transport)
     if self._unqualified_scheme == 'https':
         # Check availability of https into pycurl supported
         # protocols
         supported = pycurl.version_info()[8]
         if 'https' not in supported:
             raise errors.DependencyNotPresent('pycurl', 'no https support')
     self.cabundle = ca_bundle.get_ca_path()
 def test_env_var(self):
     self.overrideEnv('CURL_CA_BUNDLE', 'foo.bar')
     self._make_file()
     self.assertEqual('foo.bar', ca_bundle.get_ca_path(use_cache=False))
 def test_found_nothing(self):
     self.assertEqual('', ca_bundle.get_ca_path(use_cache=False))
Beispiel #6
0
 def test_env_var(self):
     self.overrideEnv('CURL_CA_BUNDLE', 'foo.bar')
     self._make_file()
     self.assertEqual('foo.bar', ca_bundle.get_ca_path(use_cache=False))
Beispiel #7
0
 def test_found_nothing(self):
     self.assertEqual('', ca_bundle.get_ca_path(use_cache=False))
 def test_env_var(self):
     osutils.set_or_unset_env('CURL_CA_BUNDLE', 'foo.bar')
     self._make_file()
     self.assertEqual('foo.bar', ca_bundle.get_ca_path(use_cache=False))