Skip to content

Commit

Permalink
fix: Add proper aliases in test app's handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Stranger6667 committed Dec 11, 2019
1 parent d1eae1e commit e94c6a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/app/__init__.py
Expand Up @@ -25,15 +25,15 @@ class Endpoint(Enum):
slow = ("GET", "/api/slow", handlers.slow)
path_variable = ("GET", "/api/path_variable/{key}", handlers.success)
unsatisfiable = ("POST", "/api/unsatisfiable", handlers.unsatisfiable)
invalid = ("POST", "/api/invalid", handlers.unsatisfiable)
invalid = ("POST", "/api/invalid", handlers.invalid)
flaky = ("GET", "/api/flaky", handlers.flaky)
multipart = ("POST", "/api/multipart", handlers.multipart)
teapot = ("POST", "/api/teapot", handlers.teapot)
text = ("GET", "/api/text", handlers.text)
malformed_json = ("GET", "/api/malformed_json", handlers.malformed_json)
invalid_response = ("GET", "/api/invalid_response", handlers.invalid_response)
custom_format = ("GET", "/api/custom_format", handlers.success)
invalid_path_parameter = ("GET", "/api/invalid_path_parameter/{id}", handlers.success)
custom_format = ("GET", "/api/custom_format", handlers.custom_format)
invalid_path_parameter = ("GET", "/api/invalid_path_parameter/{id}", handlers.invalid_path_parameter)


def create_app(endpoints: Tuple[str, ...] = ("success", "failure")) -> web.Application:
Expand Down
7 changes: 6 additions & 1 deletion test/app/handlers.py
Expand Up @@ -11,7 +11,7 @@ async def invalid_response(request: web.Request) -> web.Response:
return web.json_response({"random": "key"})


async def digits(request: web.Request) -> web.Response:
async def custom_format(request: web.Request) -> web.Response:
return web.json_response({"value": request.query["id"]})


Expand Down Expand Up @@ -54,3 +54,8 @@ async def multipart(request: web.Request) -> web.Response:
raise web.HTTPUnsupportedMediaType
data = {field.name: (await field.read()).decode() async for field in await request.multipart()}
return web.json_response(data)


path_variable = success
invalid = success
invalid_path_parameter = success

0 comments on commit e94c6a0

Please sign in to comment.