コード例 #1
0
 def test_itercerts(self):
     cert1 = Certificate(CERT1)
     cert2 = Certificate(CERT2)
     certstore = CertStore()
     for c in certstore.itercerts():
         self.assertTrue(False)
     certstore.add_cert(cert1)
     certstore.add_cert(cert2)
     for c in certstore.itercerts():
         self.assertIn(c, (cert1, cert2))
コード例 #2
0
 def test_itercerts(self):
     cert1 = Certificate(CERT1)
     cert2 = Certificate(CERT2)
     certstore = CertStore()
     for c in certstore.itercerts():
         assert False
     certstore.add_cert(cert1)
     certstore.add_cert(cert2)
     for c in certstore.itercerts():
         assert c in (cert1, cert2)
コード例 #3
0
 def test_itercerts(self):
     cert1 = Certificate(CERT1)
     cert2 = Certificate(CERT2)
     certstore = CertStore()
     for c in certstore.itercerts():
         self.assertTrue(False)
     certstore.add_cert(cert1)
     certstore.add_cert(cert2)
     for c in certstore.itercerts():
         self.assertIn(c, (cert1, cert2))
コード例 #4
0
 def test_duplicate(self):
     cert1 = Certificate(CERT1)
     certstore = CertStore()
     certstore.add_cert(cert1)
     with pytest.raises(SecurityError):
         certstore.add_cert(cert1)
コード例 #5
0
 def _get_s(self, key, cert, certs):
     store = CertStore()
     for c in certs:
         store.add_cert(Certificate(c))
     return SecureSerializer(PrivateKey(key), Certificate(cert), store)
コード例 #6
0
 def _get_s(self, key, cert, certs):
     store = CertStore()
     for c in certs:
         store.add_cert(Certificate(c))
     return SecureSerializer(PrivateKey(key), Certificate(cert), store)
コード例 #7
0
 def test_duplicate(self):
     cert1 = Certificate(CERT1)
     certstore = CertStore()
     certstore.add_cert(cert1)
     self.assertRaises(SecurityError, certstore.add_cert, cert1)
コード例 #8
0
 def test_duplicate(self):
     cert1 = Certificate(CERT1)
     certstore = CertStore()
     certstore.add_cert(cert1)
     self.assertRaises(SecurityError, certstore.add_cert, cert1)