def test_invalid_certificate_response_untrusted( untrusted_cert_b64: str) -> None: resp = _invalid_certificate_response( Headers(headers={"certificate": untrusted_cert_b64})) assert resp assert resp.status_code == 401 assert resp.body == b'{"detail":"Client certificate not trusted"}'
def test_invalid_certificate_response_malformed() -> None: resp = _invalid_certificate_response(Headers(headers={"certificate": "let me in!"})) assert resp assert resp.status_code == 400 assert resp.body == b'{"detail":"Client certificate deserialization: base64 decoding failed"}'
def test_invalid_certificate_response_missing() -> None: resp = _invalid_certificate_response(Headers(headers={})) assert resp assert resp.status_code == 400 assert resp.body == b'{"detail":"Client certificate missing in header"}'
def test_invalid_certificate_response_ok(trusted_cert_b64: str) -> None: assert _invalid_certificate_response(Headers(headers={"certificate": trusted_cert_b64})) is None