1
0
mirror of https://github.com/laurivosandi/certidude synced 2024-12-23 00:25:18 +00:00

Attempt to increase test code coverage

This commit is contained in:
Lauri Võsandi 2017-03-13 17:54:33 +02:00
parent 4fc8fbb287
commit b3185bbbf4

View File

@ -33,11 +33,14 @@ def test_cli_setup_authority():
csr = x509.CertificateSigningRequestBuilder(
).subject_name(x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, u"test")]))
with open(os.path.join(config.REQUESTS_DIR, "test.pem"), "w") as f:
f.write(csr.sign(key, hashes.SHA256(), default_backend()).public_bytes(serialization.Encoding.PEM))
authority.store_request(
csr.sign(key, hashes.SHA256(), default_backend()).public_bytes(serialization.Encoding.PEM))
result = runner.invoke(cli, ['sign', 'test', '-o'])
assert not result.exception
result = runner.invoke(cli, ['revoke', 'test'])
assert not result.exception
authority.generate_ovpn_bundle(u"test2")
authority.generate_pkcs12_bundle(u"test3")