This project is a simple clone of the AirBnB website. The first stage implements a backend interface or console to manage program data(like shell). Console commands allow users to create, update, destroy objects, and manage file storage.
- Put in place a parent class (called BaseModel) to take care of the initialization, serialization and deserialization of future instances
- Create a simple flow of serialization/deserialization: Instance <-> Dictionary <-> JSON string <-> file
- Create all classes used for AirBnB (User, State, City, Placeโฆ) that inherit from BaseModel
- Create the first abstracted storage engine of the project: File storage.
- Create all unittests to validate all our classes and storage engine
The command interpreter helps us to manage the objects of our project by:
- Creating a new object (ex: a new User or a new Place)
- Retrieving an object from a file, a database etcโฆ
- Doing operations on objects (count, compute stats, etcโฆ)
- Updating attributes of an object
- Destroying an object
./console.py
(hbnb) help
Documented commands (type help <topic>):
========================================
EOF all create delete destroy exit help q quit show update
(hbnb)
(hbnb)
(hbnb) quit
To run all the tests execute the following command:
$ python3 -m unittest discover tests
You can also run a single test by specifying the test file:
$ python3 -m unittest tests/test_models/test_city.py