Skip to content

Commit

Permalink
add some example tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillFish8 committed Jan 21, 2021
1 parent c992ca0 commit 207a331
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/target
/rewrk.exe
/venv37
/Cargo.lock
14 changes: 14 additions & 0 deletions benchmarks/python/fastapi_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import uvicorn

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def read_root():
return {"Hello": "World"}


if __name__ == "__main__":
uvicorn.run("fastapi_test:app", host="127.0.0.1", port=5002, log_level="critical")
14 changes: 14 additions & 0 deletions benchmarks/python/sanic_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from sanic import Sanic
from sanic.response import json


app = Sanic("Test")


@app.route("/")
async def test(request):
return json({"hello": "world"})


if __name__ == "__main__":
app.run(host="0.0.0.0", port=5001, debug=False, access_log=False)
2 changes: 1 addition & 1 deletion tests/test_server.py → benchmarks/python/uvicorn_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ async def app(scope, receive, send):


if __name__ == "__main__":
uvicorn.run("test_server:app", host="127.0.0.1", port=5000, log_level="critical")
uvicorn.run("uvicorn_test:app", host="127.0.0.1", port=5000, log_level="critical")

0 comments on commit 207a331

Please sign in to comment.