its an api to get users and save them in mysql database,read,and divition of two numbers.
Use the package manager pip to install fastapi.
pip install fastapi
Use the package manager pip to install uvicorn.
pip install uvicorn
Use the package manager pip install pytest-cov.
pip install pytest-cov
and for using database you should install mysql. after installing mysql,you need to change connections settings in code its not recommanded but you can make a database named my_api and a user for it named admin with password admin too.
from fastapi import Fastapi
app = Fastapi()
@app.post("/")
.
.
.
(etc...)
for runnig this api you can type this command in root directory.
uvicorn main:app
for use test unit with coverage together can use this command in root directory.
pytest --cov main
just for using it you should change first test name and phone every time unless it raises an error.
post and get requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.