def METHOD_NAME(mailoutbox, mocker, user, email_fails):
    """Assert that a UserExportBlockedException is raised if the inquiry result is denied"""
    reason_code = 100
    mock_api = mocker.patch("authentication.pipeline.compliance.api")
    mock_api.verify_user_with_exports.return_value = mocker.Mock(
        is_denied=True, is_unknown=False, reason_code=reason_code, info_code="123"
    )
    if email_fails:
        # a mail sending error should not obscurve the true error
        mocker.patch(
            "authentication.pipeline.compliance.mail.send_mail",
            side_effect=Exception("mail error"),
        )
    with pytest.raises(UserExportBlockedException) as exc:
        compliance.verify_exports_compliance(None, None, user=user)
    assert exc.value.reason_code == reason_code
    mock_api.verify_user_with_exports.assert_called_once_with(user)
    assert len(mailoutbox) == (0 if email_fails else 1)