def test_get_ca_certs_one_empty_path(self): certs = ssl.get_ca_certs(environ={ "TXAWS_CERTS_PATH": "%s:%s" % ( self.no_certs_dir, self.one_cert_dir, ), }, ) self.assertEqual(len(certs), 1)
def test_get_ca_certs_multiple_paths(self): certs = ssl.get_ca_certs(environ={ "TXAWS_CERTS_PATH": "%s:%s" % ( self.one_cert_dir, self.two_certs_dir, ), }, ) self.assertEqual(len(certs), 3)
def test_get_ca_certs_with_env_path(self): certs = ssl.get_ca_certs( environ={"TXAWS_CERTS_PATH": self.one_cert_dir}, ) self.assertEqual(len(certs), 1)
def test_get_ca_certs_with_default_path(self): self.patch(ssl, "DEFAULT_CERTS_PATH", self.two_certs_dir) certs = ssl.get_ca_certs() self.assertEqual(len(certs), 2)
def test_get_ca_certs_one_empty_path(self): os.environ["TXAWS_CERTS_PATH"] = "%s:%s" % ( self.no_certs_dir, self.one_cert_dir) certs = ssl.get_ca_certs() self.assertEqual(len(certs), 1)
def test_get_ca_certs_multiple_paths(self): os.environ["TXAWS_CERTS_PATH"] = "%s:%s" % ( self.one_cert_dir, self.two_certs_dir) certs = ssl.get_ca_certs() self.assertEqual(len(certs), 3)
def test_get_ca_certs_with_env_path(self): os.environ["TXAWS_CERTS_PATH"] = self.one_cert_dir certs = ssl.get_ca_certs() self.assertEqual(len(certs), 1)