From f88a970e2a4af0c8152659b005fff75e0499b18b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Mon, 28 Mar 2016 00:18:41 +0300 Subject: [PATCH] Attempt to fix CA test --- .travis.yml | 2 +- tests/test_ca.py | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 35beb14..5e066e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/tests/test_ca.py b/tests/test_ca.py index c61a763..531acc9 100644 --- a/tests/test_ca.py +++ b/tests/test_ca.py @@ -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