diff options
Diffstat (limited to 'test_api/test_api.py')
-rw-r--r-- | test_api/test_api.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test_api/test_api.py b/test_api/test_api.py new file mode 100644 index 0000000..bd8303d --- /dev/null +++ b/test_api/test_api.py @@ -0,0 +1,19 @@ +from bottle import get, post, run, HTTPError + +@get("/") +def get_root(): + return {"status": "OK"} + +@post("/") +def post_root(): + return {"status": "SUCCESS"} + +@get("/errors/404") +def error_404(): + raise HTTPError(404, body={"error": "no exist"}) + +@get("/errors/500") +def error_500(): + raise HTTPError(500, body={"error": "server error"}) + +run(host="localhost", port=8080) |