1
0
mirror of https://github.com/laurivosandi/certidude synced 2024-12-22 08:15:18 +00:00

Attempt to fix CA test

This commit is contained in:
Lauri Võsandi 2016-03-28 00:18:41 +03:00
parent 8ca809b546
commit f88a970e2a
2 changed files with 4 additions and 15 deletions

View File

@ -8,7 +8,7 @@ after_success:
virtualenv:
system_site_packages: true
before_install:
- sudo apt-get install -qq python-configparser python-cffi
- sudo apt-get install -qq python-configparser python-setuptools
- pip install codecov pytest-cov
install:
- pip install -r requirements.txt

View File

@ -1,25 +1,14 @@
from click.testing import CliRunner
from certidude.cli import entry_point as cli
from certidude.wrappers import CertificateAuthorityConfig
runner = CliRunner()
def test_ca_config():
# Authority setup
with runner.isolated_filesystem():
result = runner.invoke(cli, ['setup', 'authority', 'xca'])
result = runner.invoke(cli, ['setup', 'authority'])
assert not result.exception
# Load CA
conf = CertificateAuthorityConfig('./xca/openssl.cnf.example')
assert conf.ca_list == ['xca']
ca = conf.instantiate_authority('xca')
cert = ca.certificate
assert cert.serial_number == '0000000000000000000000000000000000000001'
from certidude import authority
assert authority.certificate.serial_number == '0000000000000000000000000000000000000001'
# TODO: Figure out a way to properly test cert.signed, cert.expires, cert.digest, etc