1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-07-29 18:08:31 +00:00

Type hints for tests

This commit is contained in:
Unrud 2021-07-26 20:56:47 +02:00
parent 0de8628952
commit b65d49788a
12 changed files with 501 additions and 379 deletions

View file

@ -21,13 +21,16 @@ Custom web plugin.
from http import client
from radicale import httputils, web
from radicale import httputils, types, web
class Web(web.BaseWeb):
def get(self, environ, base_prefix, path, user):
def get(self, environ: types.WSGIEnviron, base_prefix: str, path: str,
user: str) -> types.WSGIResponse:
return client.OK, {"Content-Type": "text/plain"}, "custom"
def post(self, environ, base_prefix, path, user):
def post(self, environ: types.WSGIEnviron, base_prefix: str, path: str,
user: str) -> types.WSGIResponse:
content = httputils.read_request_body(self.configuration, environ)
return client.OK, {"Content-Type": "text/plain"}, "echo:" + content