git clone "https://github.com/alexaorrico/AirBnB_clone.git"
cd AirBnB_clone
./console
and enter commandecho "<command>" | ./console.py
EOF
- exits consolequit
- exits console<emptyline>
- overwrites default emptyline method and does nothingcreate
- Creates a new instance ofBaseModel
, saves it (to the JSON file) and prints the iddestroy
- Deletes an instance based on the class name and id (save the change into the JSON file).show
- Prints the string representation of an instance based on the class name and id.all
- Prints all string representation of all instances based or not on the class name.update
- Updates an instance based on the class name and id by adding or updating attribute (save the change into the JSON file).models/
directory contains classes used for this project:def __init__(self, *args, **kwargs)
- Initialization of the base modeldef __str__(self)
- String representation of the BaseModel classdef save(self)
- Updates the attribute updated_at
with the current datetimedef to_dict(self)
- returns a dictionary containing all keys/values of the instance/models/engine
directory contains File Storage class that handles JASON serialization and deserialization :def all(self)
- returns the dictionary __objectsdef new(self, obj)
- sets in __objects the obj with key .iddef save(self)
- serializes __objects to the JSON file (path: __file_path) def reload(self)
- deserializes the JSON file to __objects/tests
directory contains all unit test cases for this project:def setUpClass(cls)
- Set up for the doc testsdef test_pep8_conformance_base_model(self)
- Test that models/base_model.py conforms to PEP8def test_pep8_conformance_test_base_model(self)
- Test that tests/test_models/test_base_model.py conforms to PEP8def test_bm_module_docstring(self)
- Test for the base_model.py module docstringdef test_bm_class_docstring(self)
- Test for the BaseModel class docstringdef test_bm_func_docstrings(self)
- Test for the presence of docstrings in BaseModel methodsdef test_is_base_model(self)
- Test that the instatiation of a BaseModel worksdef test_created_at_instantiation(self)
- Test created_at is a pub. instance attribute of type datetimedef test_updated_at_instantiation(self)
- Test updated_at is a pub. instance attribute of type datetimedef test_diff_datetime_objs(self)
- Test that two BaseModel instances have different datetime objectsdef setUpClass(cls)
- Set up for the doc testsdef test_pep8_conformance_amenity(self)
- Test that models/amenity.py conforms to PEP8def test_pep8_conformance_test_amenity(self)
- Test that tests/test_models/test_amenity.py conforms to PEP8def test_amenity_module_docstring(self)
- Test for the amenity.py module docstringdef test_amenity_class_docstring(self)
- Test for the Amenity class docstringdef setUpClass(cls)
- Set up for the doc testsdef test_pep8_conformance_city(self)
- Test that models/city.py conforms to PEP8def test_pep8_conformance_test_city(self)
- Test that tests/test_models/test_city.py conforms to PEP8def test_city_module_docstring(self)
- Test for the city.py module docstringdef test_city_class_docstring(self)
- Test for the City class docstringdef setUpClass(cls)
- Set up for the doc testsdef test_pep8_conformance_file_storage(self)
- Test that models/file_storage.py conforms to PEP8def test_pep8_conformance_test_file_storage(self)
- Test that tests/test_models/test_file_storage.py conforms to PEP8def test_file_storage_module_docstring(self)
- Test for the file_storage.py module docstringdef test_file_storage_class_docstring(self)
- Test for the FileStorage class docstringdef setUpClass(cls)
- Set up for the doc testsdef test_pep8_conformance_place(self)
- Test that models/place.py conforms to PEP8.def test_pep8_conformance_test_place(self)
- Test that tests/test_models/test_place.py conforms to PEP8.def test_place_module_docstring(self)
- Test for the place.py module docstringdef test_place_class_docstring(self)
- Test for the Place class docstringdef setUpClass(cls)
- Set up for the doc testsdef test_pep8_conformance_review(self)
- Test that models/review.py conforms to PEP8def test_pep8_conformance_test_review(self)
- Test that tests/test_models/test_review.py conforms to PEP8def test_review_module_docstring(self)
- Test for the review.py module docstringdef test_review_class_docstring(self)
- Test for the Review class docstringdef setUpClass(cls)
- Set up for the doc testsdef test_pep8_conformance_state(self)
- Test that models/state.py conforms to PEP8def test_pep8_conformance_test_state(self)
- Test that tests/test_models/test_state.py conforms to PEP8def test_state_module_docstring(self)
- Test for the state.py module docstringdef test_state_class_docstring(self)
- Test for the State class docstringdef setUpClass(cls)
- Set up for the doc testsdef test_pep8_conformance_user(self)
- Test that models/user.py conforms to PEP8def test_pep8_conformance_test_user(self)
- Test that tests/test_models/test_user.py conforms to PEP8def test_user_module_docstring(self)
- Test for the user.py module docstringdef test_user_class_docstring(self)
- Test for the User class docstring