/AirBnB_clone

This is a Clone Project based on AirBnB. It provides the console and interfaces for login

Primary LanguagePython

AirBnB_clone aka hbnb

Table of contents

Introduction

This is a solo project to build a clone (hbnb) of AirBnB for ALX SE Course.

The console is a command interpreter for clone AirBnb Project and it performs the following tasks:

  • Creating a new object
  • Retriving an object from a file
  • Performing operations on objects
  • Destroying an object

Storage

Classes created are managed by the Storage engine in the FileStorage Class.

Environment

The following are the enviroment used to design, test and run the clone AirBnB console. All the development and testing was done using these platforms:

  • MacOs Ventura 13.6.4 and OS Ubuntu 22.04 LTS
  • Python 3.11.2
  • VSCode 1.86
  • Vim 9.0
  • Code version control with Git 2.39.5
  • Code hosting via GitHub

Apple Ubuntu terminal Python Suite CRM Visual Studio git distributed version control system Github

Installation

git clone https://github.com/evans-manyala/AirBnB_clone.git

Change to the AirBnb directory and run the command:

 ./console.py

Execution

For the interactive mode

$ ./console.py
(hbnb) help

Documented commands (type help <topic>):
========================================
EOF  help  quit

(hbnb)
(hbnb)
(hbnb) quit
$

For the Non-interactive mode

$ echo "help" | ./console.py
(hbnb)

Documented commands (type help <topic>):
========================================
EOF  help  quit
(hbnb)
$
$ cat test_help
help
$
$ cat test_help | ./console.py
(hbnb)

Documented commands (type help <topic>):
========================================
EOF  help  quit
(hbnb)
$

Testing

For all the unit testing, these are defined in the tests folder.

Documentation

  • Modules:
python3 -c 'print(__import__("my_module").__doc__)'
  • Classes:
python3 -c 'print(__import__("my_module").MyClass.__doc__)'
  • Functions (inside and outside a class):
python3 -c 'print(__import__("my_module").my_function.__doc__)'

and

python3 -c 'print(__import__("my_module").MyClass.my_function.__doc__)'

Python Unit Tests

  • unittest module
  • File extension .py
  • Files and folders star with test_
  • Organization:for models/base.py, unit tests in: tests/test_models/test_base.py
  • Execution command: python3 -m unittest discover tests
  • or: python3 -m unittest tests/test_models/test_base.py

run test in interactive mode

echo "python3 -m unittest discover tests" | bash

run test in non-interactive mode

To perform the tests in non-interactive mode, use the command:

python3 -m unittest discover tests```


- Quit the console:

```bash
(hbnb) quit
$

Authors

Evans Manyala Typing SVG