Project 11 OpenClassrooms Path - Gudlft -- Improve a Python web application through testing and debugging
Güdlft is a company that has created a digital platform to coordinate strength competitions. Güdlft has set up a team called Regional Outreach to create a lighter (and cheaper) version of their current platform for regional organisers. The aim of the application is to streamline the management of competitions between clubs.
The prototype is stored in this GitHub repository. In the issue section of this repository are bugs to fix and features to implement. The second step is to create functional and integration tests to make sure the functionality.
To implement unit tests, in branch modification/server
I add functions to be able to make
unit tests for a single function. In branch tests/server
there are several unit tests. These two
branches are not integrated into QA
or main
.
open terminal
- clone the repository:
git clone https://github.com/DoriDoro/Gudlft.git
- go to folder:
cd Gudlft
- install the virtual environment:
python3 -m venv venv
- activate the virtual environment with following command:
- on MacOS and Linux:
. venv/bin/activate
- on Windows:
venv\Script\activate
- on MacOS and Linux:
- install all dependencies with:
pip install -r requirements.txt
- run the server with:
export FLASK_APP=server export FLASK_ENV=development flask run
To run all the tests use:
pytest
- If you want to check one folder use (example):
pytest tests/integration_tests/
- If you want to test one file use (example):
pytest tests/functional_tests/test_book.py
check the coverage of testing:
installed package:
pytest-cov
(This plugin produces coverage reports)
- use this command to check the coverage:
pytest --cov=Python_Testing tests/
- to create the report use:
coverage html
- Implement a Python test suite
- Handling errors and exceptions in Python
- Configure a Python environment
- Debug the code of a Python application
4. successful purchase of places
5. Error when purchase more than 12 places