def test_convert_params_validate():

    class User(wsgiservice.Resource):
        @wsgiservice.validate('a', convert=int)
        def POST(self, a):
            return {'a': a}

    data = {'a': 'b'}
    req = webob.Request.blank('/', headers={'Accept': 'application/json',
                                            'Content-Type': 'application/json'},
                              method='POST', body=json.dumps(data))
    res = webob.Response()
    usr = User(request=req, response=res, path_params={})
    res = usr()
    print res
    assert res.status_int == 400
    obj = json.loads(res.body)
    assert obj == {"error": "a value b does not validate."}
The number of participants for a certain variant.
dataset/ETHPy150Open pneff/wsgiservice/tests/test_resource_json.py/test_convert_params_validate--crossover with--dataset/ETHPy150Open ryanpetrello/cleaver/cleaver/backend/__init__.py/CleaverBackend.participants