def test_bool_arg_default(app, parser): arg = utils.make_bool_arg(default=True) request = app.test_request_context('/').request assert parser.parse_arg('test_bool', arg, request) is True
def test_bool_arg_invalid(app, parser): arg = utils.make_bool_arg() request = app.test_request_context('/?test_bool=nope').request with pytest.raises(ValidationError): parser.parse_arg('test_bool', arg, request)
def test_bool_arg_false(app, parser): arg = utils.make_bool_arg() request = app.test_request_context('/?test_bool=false').request assert parser.parse_arg('test_bool', arg, request) is False