tests
This commit is contained in:
parent
e530664da6
commit
8e5e8fdd03
|
@ -84,6 +84,27 @@ def test_get_by_serial(session, certificate):
|
||||||
assert found
|
assert found
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_all_certs_attached_to_endpoint_without_autorotate(session):
|
||||||
|
from lemur.certificates.service import get_all_certs_attached_to_endpoint_without_autorotate, \
|
||||||
|
cleanup_after_revoke
|
||||||
|
from lemur.tests.factories import EndpointFactory, CertificateFactory
|
||||||
|
|
||||||
|
# add a certificate with endpoint
|
||||||
|
s = EndpointFactory()
|
||||||
|
CertificateFactory(endpoint=s)
|
||||||
|
session.commit()
|
||||||
|
|
||||||
|
list_before = get_all_certs_attached_to_endpoint_without_autorotate()
|
||||||
|
len_list_before = len(list_before)
|
||||||
|
assert len_list_before > 0
|
||||||
|
# revoked the first certificate
|
||||||
|
first_cert_with_endpoitn = list_before[0]
|
||||||
|
cleanup_after_revoke(first_cert_with_endpoitn)
|
||||||
|
|
||||||
|
list_after = get_all_certs_attached_to_endpoint_without_autorotate()
|
||||||
|
assert len(list_after) + 1 == len_list_before
|
||||||
|
|
||||||
|
|
||||||
def test_delete_cert(session):
|
def test_delete_cert(session):
|
||||||
from lemur.certificates.service import delete, get
|
from lemur.certificates.service import delete, get
|
||||||
from lemur.tests.factories import CertificateFactory
|
from lemur.tests.factories import CertificateFactory
|
||||||
|
|
Loading…
Reference in New Issue