MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_DER_to_PEM

Method test_DER_to_PEM

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

Source from the content-addressed store, hash-verified

500 )
501
502 def test_DER_to_PEM(self):
503 with open(CAFILE_CACERT, 'r') as f:
504 pem = f.read()
505 d1 = ssl.PEM_cert_to_DER_cert(pem)
506 p2 = ssl.DER_cert_to_PEM_cert(d1)
507 d2 = ssl.PEM_cert_to_DER_cert(p2)
508 self.assertEqual(d1, d2)
509 if not p2.startswith(ssl.PEM_HEADER + '\n'):
510 self.fail("DER-to-PEM didn't include correct header:\n%r\n" % p2)
511 if not p2.endswith('\n' + ssl.PEM_FOOTER + '\n'):
512 self.fail("DER-to-PEM didn't include correct footer:\n%r\n" % p2)
513
514 def test_openssl_version(self):
515 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