You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# BankAccount
2
2
This is an educational public repository to illustrate the power of automated testing through Github Actions.
3
3
4
-
# Run locally
4
+
##Run locally
5
5
1. Set up Python virtual environment.
6
6
```
7
7
python -m venv venv
@@ -17,4 +17,18 @@ python -m pytest
17
17
4. Run the app.
18
18
```
19
19
python app.py
20
-
```
20
+
```
21
+
22
+
## Code Description
23
+
24
+
1. app.py: A flask application that exposes the following API endpoints:
25
+
- index at / : Retun a JSON data structure indicating the current balance.
26
+
- deposit at /deposit : Take the deposit amount as a URL parameter and return the new balance after adding the amount.
27
+
- withdraw at /withdraw : Take the withdrawal amount as a URL parameter and return the new balance after subtracting the amount.
28
+
App relies on a global in-memory variable (`balance`) to store the balance of the account.
29
+
30
+
2. requirements.txt: A text file including all the Python libraries and packages needed to run the app.
31
+
32
+
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.
33
+
34
+
4. tests: It's a directory that includes several unit tests for the APIs. The tests utilize the PyTest library.
0 commit comments