MCPcopy Index your code
hub / github.com/python/cpython / test_DER_to_PEM

Method test_DER_to_PEM

Lib/test/test_ssl.py:583–593  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

581 )
582
583 def test_DER_to_PEM(self):
584 with open(CAFILE_CACERT, 'r') as f:
585 pem = f.read()
586 d1 = ssl.PEM_cert_to_DER_cert(pem)
587 p2 = ssl.DER_cert_to_PEM_cert(d1)
588 d2 = ssl.PEM_cert_to_DER_cert(p2)
589 self.assertEqual(d1, d2)
590 if not p2.startswith(ssl.PEM_HEADER + '\n'):
591 self.fail("DER-to-PEM didn't include correct header:\n%r\n" % p2)
592 if not p2.endswith('\n' + ssl.PEM_FOOTER + '\n'):
593 self.fail("DER-to-PEM didn't include correct footer:\n%r\n" % p2)
594
595 def test_openssl_version(self):
596 n = ssl.OPENSSL_VERSION_NUMBER

Callers

nothing calls this directly

Calls 6

openFunction · 0.50
readMethod · 0.45
assertEqualMethod · 0.45
startswithMethod · 0.45
failMethod · 0.45
endswithMethod · 0.45

Tested by

no test coverage detected