MCPcopy
hub / github.com/pyca/cryptography / _check_ocsp_response_times

Function _check_ocsp_response_times

tests/x509/test_ocsp.py:72–98  ·  view source on GitHub ↗
(
    ocsp_resp: ocsp.OCSPResponse,
    this_update: datetime.datetime,
    next_update: Optional[datetime.datetime],
    revocation_time: Optional[datetime.datetime],
)

Source from the content-addressed store, hash-verified

70
71
72def _check_ocsp_response_times(
73 ocsp_resp: ocsp.OCSPResponse,
74 this_update: datetime.datetime,
75 next_update: Optional[datetime.datetime],
76 revocation_time: Optional[datetime.datetime],
77) -> None:
78 with pytest.warns(utils.DeprecatedIn43):
79 assert ocsp_resp.this_update == this_update
80 assert ocsp_resp.this_update_utc == this_update.replace(
81 tzinfo=datetime.timezone.utc
82 )
83
84 with pytest.warns(utils.DeprecatedIn43):
85 assert ocsp_resp.next_update == next_update
86 assert ocsp_resp.next_update_utc == (
87 next_update.replace(tzinfo=datetime.timezone.utc)
88 if next_update is not None
89 else None
90 )
91
92 with pytest.warns(utils.DeprecatedIn43):
93 assert ocsp_resp.revocation_time == revocation_time
94 assert ocsp_resp.revocation_time_utc == (
95 revocation_time.replace(tzinfo=datetime.timezone.utc)
96 if revocation_time is not None
97 else None
98 )
99
100
101class TestOCSPRequest:

Callers 8

test_sign_good_certMethod · 0.85
test_load_responseMethod · 0.85
test_sign_ed25519Method · 0.85
test_sign_ed448Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected