mirror of
				https://github.com/laurivosandi/certidude
				synced 2025-10-31 01:19:11 +00:00 
			
		
		
		
	Attempt to fix CA test
This commit is contained in:
		| @@ -8,7 +8,7 @@ after_success: | |||||||
| virtualenv: | virtualenv: | ||||||
|   system_site_packages: true |   system_site_packages: true | ||||||
| before_install: | 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 |   - pip install codecov pytest-cov | ||||||
| install: | install: | ||||||
|   - pip install -r requirements.txt |   - pip install -r requirements.txt | ||||||
|   | |||||||
| @@ -1,25 +1,14 @@ | |||||||
| from click.testing import CliRunner | from click.testing import CliRunner | ||||||
| from certidude.cli import entry_point as cli | from certidude.cli import entry_point as cli | ||||||
|  |  | ||||||
|  |  | ||||||
| from certidude.wrappers import CertificateAuthorityConfig |  | ||||||
|  |  | ||||||
| runner = CliRunner() | runner = CliRunner() | ||||||
|  |  | ||||||
| def test_ca_config(): | def test_ca_config(): | ||||||
|     # Authority setup |     # Authority setup | ||||||
|     with runner.isolated_filesystem(): |     with runner.isolated_filesystem(): | ||||||
|         result = runner.invoke(cli, ['setup', 'authority', 'xca']) |         result = runner.invoke(cli, ['setup', 'authority']) | ||||||
|         assert not result.exception |         assert not result.exception | ||||||
|  |  | ||||||
|         # Load CA |         from certidude import authority | ||||||
|         conf = CertificateAuthorityConfig('./xca/openssl.cnf.example') |         assert authority.certificate.serial_number == '0000000000000000000000000000000000000001' | ||||||
|  |  | ||||||
|         assert conf.ca_list == ['xca'] |  | ||||||
|  |  | ||||||
|         ca = conf.instantiate_authority('xca') |  | ||||||
|  |  | ||||||
|         cert = ca.certificate |  | ||||||
|  |  | ||||||
|         assert cert.serial_number == '0000000000000000000000000000000000000001' |  | ||||||
|         # TODO: Figure out a way to properly test cert.signed, cert.expires, cert.digest, etc |         # TODO: Figure out a way to properly test cert.signed, cert.expires, cert.digest, etc | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user