A Todo REST API developed using Python and Flask and the flask-smorest extension. The API routes have been tested using POSTMAN API tests for the Todo API were developed using pytest.
REST API
Uses Marshmallow Schemas and
pytest tests to test the API and view the test results in an HTML file
In the terminal, type:
git clone https://github.com/lakshmi2812/Todo-Flask-Pytest-project.git
cd Todo-Flask-Pytest-project
Python 3.x
poetry
pip
pip install pipx
pipx install poetry
pip install Flask
pip install flask-smorest
pip install marshmallow
pip install pytest pytest-flask
pip install pytest-html
In the command line, type the following command: FLASK_APP=app:server flask run --reload
Use an API testing tool like POSTMAN or Insomnia or any other tool of your choice and test the various API routes.
Go to the project root directry and make sure that the app server is running.
Now, in a separate tab, run the following command from the project root directory:
python3 -m pytest --html=report.html
The above command will run the tests and the results will be stored in a file called report.html
Open the report.html file using your favorite web browser to see the results of the API tests.