':py:obj:`dump_certificate` writes PEM, DER, and text.'

def test_dump_certificate(self):

    pemData = (cleartextCertificatePEM + cleartextPrivateKeyPEM)
    cert = load_certificate(FILETYPE_PEM, pemData)
    dumped_pem = dump_certificate(FILETYPE_PEM, cert)
    self.assertEqual(dumped_pem, cleartextCertificatePEM)
    dumped_der = dump_certificate(FILETYPE_ASN1, cert)
    good_der = _runopenssl(dumped_pem, 'x509', '-outform', 'DER')
    self.assertEqual(dumped_der, good_der)
    cert2 = load_certificate(FILETYPE_ASN1, dumped_der)
    dumped_pem2 = dump_certificate(FILETYPE_PEM, cert2)
    self.assertEqual(dumped_pem2, cleartextCertificatePEM)
    dumped_text = dump_certificate(FILETYPE_TEXT, cert)
    good_text = _runopenssl(dumped_pem, 'x509', '-noout', '-text')
    self.assertEqual(dumped_text, good_text)
