This application allows a customer or hotel employee to calculate the cheapest hotel to stay during specified dates.
The application is divided in three folders:
doc
: containing images that compose this documentationhotel_system
: main folder with the application files__init__.py
: package directory definition__main__.py
: contains themain()
function that will solve the problemcustomer.py
: class that represents aCustomer
file_handler.py
: file with auxiliary methods to handle the input fileshotel_chain.py
: class that represents aHotelChain
hotel.py
: class that represents aHotel
reservation.py
: class that represents aReservation
tests
: folder with the tests written and some test files
The solution was designed considering OO programming principles. There are four classes in the design:
Hotel
: represents a hotel in the systemCustomer
: represents a customer in the systemReservation
: represents a reservation that a customer could make for a specific hotelHotelChain
: represents a chain of multiple hotels
The picture above shows the class diagram with all attributes and methods for each class:
To run the application with a specific file:
make run FILE=/path/to/file/
To run all the tests:
make test
To clean the executables:
make clean
The figure above shows some test examples running with this solution. These test files are in
the path tests/test_files
There are 19 automatized tests written for this application. To run them use the command make test