Exemplo n.º 1
0
 def test_trusted_cert(self, *unused):
     # Test a "TRUSTED" certificate:
     cert = self._certpath2namedtuple(paths.TRUSTED_EXPIRE_41_CERT)
     expiry_time = check_cert.get_cert_expiration(cert) - self.now
     self.assertEqual(expiry_time.days, 41)
Exemplo n.º 2
0
 def test_der_cert(self, *unused):
     # Test a DER certificate:
     cert = self._certpath2namedtuple(paths.EXPIRE_41_DAYS_DER)
     with self.assertRaises(RecoverableException):
         check_cert.get_cert_expiration(cert)
Exemplo n.º 3
0
 def test_broken_cert(self, *unused):
     # Test a broken certificate:
     cert = self._certpath2namedtuple(paths.BROKEN_CERT)
     with self.assertRaises(RecoverableException):
         check_cert.get_cert_expiration(cert)
Exemplo n.º 4
0
 def test_ok_cert(self, *unused):
     # Test a good certificate:
     cert = self._certpath2namedtuple(paths.EXPIRE_21_DAYS)
     expiry_time = check_cert.get_cert_expiration(cert) - self.now
     self.assertEqual(expiry_time.days, 21)
Exemplo n.º 5
0
 def test_trusted_cert(self, *unused):
     # Test a "TRUSTED" certificate:
     cert = self._certpath2namedtuple(paths.TRUSTED_EXPIRE_41_CERT)
     expiry_time = check_cert.get_cert_expiration(cert) - self.now
     self.assertEqual(expiry_time.days, 41)
Exemplo n.º 6
0
 def test_broken_cert(self, *unused):
     # Test a broken certificate:
     cert = self._certpath2namedtuple(paths.BROKEN_CERT)
     with self.assertRaises(RecoverableException):
         check_cert.get_cert_expiration(cert)
Exemplo n.º 7
0
 def test_der_cert(self, *unused):
     # Test a DER certificate:
     cert = self._certpath2namedtuple(paths.EXPIRE_41_DAYS_DER)
     with self.assertRaises(RecoverableException):
         check_cert.get_cert_expiration(cert)
Exemplo n.º 8
0
 def test_ok_cert(self, *unused):
     # Test a good certificate:
     cert = self._certpath2namedtuple(paths.EXPIRE_21_DAYS)
     expiry_time = check_cert.get_cert_expiration(cert) - self.now
     self.assertEqual(expiry_time.days, 21)