Skip to content

Commit 13d0c96

Browse files
authored
Merge pull request #46 from OwnCA/fix_lint_tests
Fix lint and tests
2 parents 64fac23 + 391f049 commit 13d0c96

4 files changed

Lines changed: 10 additions & 13 deletions

File tree

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ init:
44
pipenv install --dev
55

66
all-tests:
7-
tox -r
7+
tox -re all_tests,pep8
88
coverage xml -i
99
coverage html -i
1010

@@ -22,10 +22,6 @@ py38-tests:
2222
integration-tests:
2323
tox -re integrations
2424

25-
all-tests:
26-
tox -re all_tests
27-
coverage xml -i
28-
coverage html -i
2925

3026
publish-test:
3127
pip install 'twine>=1.5.0'

ownca/ownca.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
"""
4-
Copyright (c) 2018-2020 Kairo de Araujo
4+
Copyright (c) 2018-2021 Kairo de Araujo
55
"""
66

77
from cryptography import x509
@@ -1138,7 +1138,9 @@ def sign_csr(self, csr, csr_public_key, maximum_days=825):
11381138
csr_bytes = csr.public_bytes(
11391139
encoding=serialization.Encoding.PEM
11401140
)
1141-
host_cert_dir = os.path.join(self.ca_storage, CA_CERTS_DIR, common_name)
1141+
host_cert_dir = os.path.join(
1142+
self.ca_storage, CA_CERTS_DIR, common_name
1143+
)
11421144

11431145
certificate = ca_sign_csr(
11441146
self.cert, self.key, csr, csr_public_key,

ownca/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
"""
4-
Copyright (c) 2018-2020 Kairo de Araujo
4+
Copyright (c) 2018-2021 Kairo de Araujo
55
"""
66

77
from glob import glob
8-
import inspect
98
import os
109
import re
1110

@@ -92,7 +91,8 @@ def ownca_directory(ca_storage):
9291
"""
9392
if "CA_test".lower() in ca_storage.lower() and not os.getenv("TEST_MODE"):
9493
raise ValueError(
95-
f"Not allowed {ca_storage}. Please do not use a name that contains 'ca_test'"
94+
f"Not allowed {ca_storage}. Please do not use a name that "
95+
+ "contains 'ca_test'"
9696
)
9797

9898
ownca_status = {

tests/integrations/test_ca.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright 2020 Kairo de Araujo
4+
# Copyright 2020,2021 Kairo de Araujo
55
#
66

77
from cryptography import x509
@@ -181,7 +181,6 @@ def test_ica():
181181
"certificate file in CA Storage"
182182
) in err.value
183183

184-
185184
assert isinstance(ca.key, rsa.RSAPrivateKeyWithSerialization)
186185
assert type(ca.public_key_bytes) == bytes
187186
assert ca.public_key_bytes.startswith(b"ssh-rsa")
@@ -261,4 +260,4 @@ def test_ca_sign_ica():
261260
assert ca.type == "Certificate Authority"
262261
assert ica.type == "Intermediate Certificate Authority"
263262
assert ica.cert.subject.rfc4514_string() == 'CN=ica.dev.ownca.org'
264-
assert ica.cert.issuer.rfc4514_string() == 'CN=ownca.org'
263+
assert ica.cert.issuer.rfc4514_string() == 'CN=ownca.org'

0 commit comments

Comments
 (0)