Assignment 2

The file library_mixed.py contains the source code of a not particularly well written service. Your task is to do two things (there are more issues in the code, but you should focus on these ones).
  1. The code contains two concerns that are mixed - the business logic and logging. Refactor the code so that we will have three distinct parts, a part that contains business logic, a part that construct the strings and a part that prints it on the screen. You might need to do subtle changes in the design to attain this.
  2. Write unit tests for your program. Write proper solitary unit tests for the refactored classes Reservation and Library. You need small modifications in the design to do this. Write two or three tests for the string-constructing part of your program (full test coverage is not required).

You should write your code in Python. Send your solution to lukotka.pts@gmail.com. The first deadline is 15.4.2020 23:59:59 (I recommend submitting the assignment before Easter, so you have time to do reviews). The deadline for reviewed solution is 17.4.2020 23:59:59. The solutions sent later will be accepted, however the number of points awarded may be reduced.