Files
codeql/python/ql/test/library-tests/web/pyramid/test.py
Rasmus Wriedt Larsen 2874c54133 Python: Move pyramid tests from internal repo
Use minimal mock instead of full library
2019-10-23 16:28:46 +02:00

26 lines
452 B
Python

from pyramid.view import view_config
from pyramid.response import Response
@view_config(
route_name='home'
)
def home(request):
return Response('Welcome!')
@view_config(
route_name='greet',
request_method='POST'
)
def greet(request):
name = request.POST['arg']
return Response('Welcome %s!' % name)
@view_config(
route_name='stuff',
renderer='json'
)
def stuff(request):
return {"err": 0, "body": request.body}