Projekt

Obecné

Profil

« Předchozí | Další » 

Revize b484b79b

Přidáno uživatelem Stanislav Král před téměř 4 roky(ů)

Covered test cases where CertificateService should/shouldn't raise InvalidSubjectAttribute error

Zobrazit rozdíly:

tests/integration_tests/services/conftest.py
9 9
from src.dao.certificate_repository import CertificateRepository
10 10
from src.dao.private_key_repository import PrivateKeyRepository
11 11
from src.db.init_queries import SCHEMA_SQL, DEFAULT_VALUES_SQL
12
from src.model.subject import Subject
12 13
from src.services.certificate_service import CertificateService
13 14
from src.services.crl_ocsp.crl_ocsp_service import CrlOcspService
14 15
from src.services.cryptography import CryptographyService
......
57 58
    return ConnectionProvider().connect(test_configuration())
58 59

  
59 60

  
61
@pytest.fixture
62
def sample_private_key(private_key_service):
63
    return private_key_service.create_new_key()
64

  
65

  
66
@pytest.fixture
67
def sample_certificate(certificate_service, sample_private_key):
68
    return certificate_service.create_root_ca(sample_private_key, Subject("Foo"))
69

  
70

  
60 71
# scope defaults to "function" which means that the fixture is run once per test (function)
61 72
@pytest.fixture
62 73
def certificate_repository_unique(connection_unique):

Také k dispozici: Unified diff