1
0
mirror of https://github.com/laurivosandi/certidude synced 2024-11-10 23:20:35 +00:00
certidude/tests/test_cli.py
2016-09-18 18:30:31 +03:00

26 lines
816 B
Python

from click.testing import CliRunner
from certidude.cli import entry_point as cli
from datetime import datetime, timedelta
runner = CliRunner()
def test_cli_setup_authority():
# Authority setup
# TODO: parent, common-name, country, state, locality
# {authority,certificate,revocation-list}-lifetime
# organization, organizational-unit
# pkcs11
# {crl-distribution,ocsp-responder}-url
# email-address
# inbox, outbox
result = runner.invoke(cli, ['setup', 'authority'])
assert not result.exception
from certidude import authority
assert authority.certificate.serial_number == '0000000000000000000000000000000000000001'
assert authority.certificate.signed < datetime.now()
assert authority.certificate.expires > datetime.now() + timedelta(days=7000)