def testItShouldHaveACAAfterLoading(self): old_ca = CA() old_ca.create_ca() key_pem = CA.pkey_to_pem(old_ca.ca_key) cert_pem = CA.certificate_to_pem(old_ca.ca_cert) ca = CA() ca.load(key_pem, cert_pem) assert ca.has_ca()
def testItShouldNotLoadACAFromInvalidKeyMaterial(self): old_ca = CA() old_ca.create_ca() key_pem = CA.pkey_to_pem(old_ca.ca_key) old_ca.create_ca() cert_pem = CA.certificate_to_pem(old_ca.ca_cert) ca = CA() assert not ca.load(key_pem, cert_pem) assert not ca.has_ca()
def testItShouldHaveACAAfterCreation(self): ca = CA() ca.create_ca() assert ca.has_ca()
def testItShouldNotHaveACAByDefault(self): ca = CA() assert not ca.has_ca()