def METHOD_NAME(param, result):
    params = {'test': param} if param is not None else {}
    # incorrect param should call exception
    if result is None:
        error = False
        try:
            bool_from_request(params, 'test', 0)
        except:  # noqa: E722
            error = True
        assert error
    # everything ok
    else:
        assert bool_from_request(params, 'test', 0) == result