def testCheckValuePemX509CertWhenBadlyFormed(self):
    k = 'k'
    pem_cert = 'pem'

    self.mox.StubOutWithMock(settings.x509, 'LoadCertificateFromPEM')
    settings.x509.LoadCertificateFromPEM(pem_cert).AndRaise(
        settings.x509.Error)

    self.mox.ReplayAll()
    self.assertRaises(
        ValueError, self.settings.CheckValuePemX509Cert, k, pem_cert)
    self.mox.VerifyAll()
Test CheckValuePemX509Cert().
dataset/ETHPy150Open google/simian/src/tests/simian/settings_test.py/BaseSettingsTest.testCheckValuePemX509CertWhenBadlyFormed