In this project we will develop a simple copy of the AirBnB website, starting now until the end of the first year. In this first part we developed the console.
Command interpreter based in cmd to manipulate data without a visual interface, like in a Shell (perfect for development and debugging)
- Create our data model
- Manage (create, update, destroy, etc) objects via a console/command interpreter
- Store and persist objects to a file (JSON file).
The first piece (the console) is to manipulate a powerful storage system. This storage engine will give us an abstraction between "My object" and "How they are stored and persisted". This means: from your console code (the command interpreter itself) and from the front-end and RestAPI you will build later.
./console.py
(hbnb) help
Documented commands (type help <topic>):
========================================
EOF help quit
(hbnb)
(hbnb)
(hbnb) quit
$
They should pass in non-interactive mode: $ echo "python3 -m unittest discover tests" | bash
File | Description | Attributes |
---|---|---|
help |
Display all commands available | help |
create |
Creates new object | create (class here) |
update |
Updates attribute of an object | User.update('123', {'name': 'Greg_n_Mel'}) |
all |
Display all objects in class | user.all |
show |
Retrieve an object from a file | user.show |
destroy |
Destroy specified object | User.destroy('123') |
quit |
Close the console | quit |
File | Description | Attributes |
---|---|---|
base_model.py |
BaseModel class for all the sub-classes | id, created_at, updated_at |
user.py |
User class for user information. | email, password, first_name, last_name |
amenity.py |
Amenity class for information about amenities. | name |
city.py |
City class for information about the city. | state_id, name |
state.py |
State class for information about the state. | name |
place.py |
Place class for details of the AirBnB apartments for rent. | city_id, user_id, name, description, number_rooms, number_bathrooms, max_guest, price_by_night, latitude, longitude, amenity_ids |
review.py |
Review class for review information from the user/client. | place_id, user_id, text |
Clone the repository in this link or copy the text bellow.
[email protected]:jegomezV/holbertonschool-AirBnB_clone.git
Unittests for the HolbertonBnB project are defined in the tests folder. To run the entire test suite simultaneously, execute the following command:
$ python3 unittest -m discover tests
$ python3 unittest -m tests/test_console.py