def testLoadCertificateFromPEM(self):
    header = 'BEGIN CERTIFICATE'
    footer = 'END CERTIFICATE'

    pem_input = 'pem_input'
    pem_output = ['---header---', 'base64', '---footer---']

    self.mox.StubOutWithMock(x509, 'LoadPemGeneric')
    self.mox.StubOutWithMock(x509, 'LoadCertificateFromBase64')
    x509.LoadPemGeneric(pem_input, header, footer).AndReturn(pem_output)
    x509.LoadCertificateFromBase64('base64').AndReturn('ok')

    self.mox.ReplayAll()
    self.assertEqual(x509.LoadCertificateFromPEM(pem_input), 'ok')
    self.mox.VerifyAll()
Test LoadCertificateFromPEM().
dataset/ETHPy150Open google/simian/src/tests/simian/auth/x509_test.py/X509ModuleTest.testLoadCertificateFromPEM