Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_verify_registration_response_failure(monkeypatch):
response_obj = pretend.stub(
verify=pretend.raiser(pywebauthn.webauthn.RegistrationRejectedException)
)
response_cls = pretend.call_recorder(lambda *a, **kw: response_obj)
monkeypatch.setattr(pywebauthn, "WebAuthnRegistrationResponse", response_cls)
with pytest.raises(webauthn.RegistrationRejectedException):
webauthn.verify_registration_response(
{}, "not_a_real_challenge", rp_id="fake_rp_id", origin="fake_origin"
)