This uses the Apache thrift protocol library.
In Debian (and most derivatives) it is available as python-thrift. Alternately, grab a copy and
install it from
https://thrift.apache.org/
This needs unittest :
The Unittest python testing framework, pretty much standard, known as the "batteries included" test framework, and arguably one of the most used)
-- Generating the supporting server / client code
--------------------------------------------------
If you just want to run the code, just install the python-thrift library.
To re-genrate it (you need the thrift compiler running to do this.
the generated code for client and server is provided in the folder "gen-py"
thrift --gen py atmservice
-- Running code.
** Please note that as configured, the server and client as designed to listen on localhost port 8082 only. These values can be changes in the server and client code scripts.
1. go to atmcode folder
2. start the atm (load the amount of 20$ notes and 50$ notes at start)
Usage: ./atmserver.py <number of 20$ notes> <number of 50$ notes>
3. use the client (any amounts other than multiples of 20, 50 will yield an "Invalid amount":
If successul, the client terminal will show the amount withdrawn and the amount of 20$ and 50$ bills
* at start, the server runs a self test, and will fail to start if any of the tests fail.