From c93ddabe8ef56ae07c4372d5ffc1a4287023258d Mon Sep 17 00:00:00 2001 From: Saba Jamalian Date: Sun, 12 Dec 2021 16:18:45 -0600 Subject: [PATCH] added code description to the main branch --- README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7da850cf..1580f927 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # BankAccount This is an educational public repository to illustrate the power of automated testing through Github Actions. -# Run locally +## Run locally 1. Set up Python virtual environment. ``` python -m venv venv @@ -17,4 +17,18 @@ python -m pytest 4. Run the app. ``` python app.py -``` \ No newline at end of file +``` + +## Code Description + +1. app.py: A flask application that exposes the following API endpoints: + - index at / : Retun a JSON data structure indicating the current balance. + - deposit at /deposit : Take the deposit amount as a URL parameter and return the new balance after adding the amount. + - withdraw at /withdraw : Take the withdrawal amount as a URL parameter and return the new balance after subtracting the amount. +App relies on a global in-memory variable (`balance`) to store the balance of the account. + +2. requirements.txt: A text file including all the Python libraries and packages needed to run the app. + +3. .gitignore: Refer to the gitignore article for more details. In short, this file makes it possible that local configuration or binary files are not pushed to the repository. + +4. tests: It's a directory that includes several unit tests for the APIs. The tests utilize the PyTest library. \ No newline at end of file