HolbertonBnB is a complete web application, integrating database storage, a back-end API, and front-end interfacing in a clone of AirBnB. The project currently only implements the back-end console.
Every time the backend is initialized, HolbertonBnB instantiates an instance of
FileStorage
called storage
. The storage
object is used to load
any class instances stored in the JSON file model.json
. As class instances are
created, updated, or deleted, the storage
object is used to register
corresponding changes in the file.
The console is a command line interpreter that permits management of the backend
of HolbertonBnB. It can be used to handle and manipulate all classes utilized by
the application (achieved by calls on the storage
object defined above).
To use the HolbertonBnB console, run the file console.py
by itself:
$ ./console.py
To quit the console, enter the command quit
or ctrl-D
.
$ ./console.py
(hbnb) quit
$
$ ./console.py
(hbnb) EOF
$
The HolbertonBnB console supports the following commands:
- usage:
create <class>
- show:
show <class> <id>
- destroy:
destroy <class> <id>
- all:
all [class]
- update:
update <class name> <id> <attribute name> "<attribute value>"
To run the whole test suit, execute the following command:
$ python3 -m unittest discover tests
Alternatively, you can specify a single test file to run at a time:
$ python3 -m unittest tests/test_models/test_base_model.py