octocatblain / AirBnB_clone

A command interpreter to manipulate data without a visual interface, like in a Shell (perfect for development and debugging)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AirBnB_clone

A command interpreter to manipulate data without a visual interface for the AirBNB clone website.

Project Workflow Image

Description of the project

This team project is part of the ALX School Software Engineering program. It represents the first step towards building a full web application: the AirBnB clone.

Description of the command interpreter

This first step consists of:

  • A custom command-line interface for data management,
  • The base classes for the storage of this data.

Usage ���

The console works both in interactive mode and non-interactive mode, much like a Unix shell. It prints a prompt (hbnb) and waits for the user for input.

Command Example
Run the console ./console.py
Quit the console (hbnb) quit
Display the help for a command (hbnb) help <command>
Create an object (prints its id) (hbnb) create <class>
Show an object (hbnb) show <class> <id> or (hbnb) <class>.show(<id>)
Destroy an object (hbnb) destroy <class> <id> or (hbnb) <class>.destroy(<id>)
Show all objects, or all instances of a class (hbnb) all or (hbnb) all <class>
Update an attribute of an object (hbnb) update <class> <id> <attribute name> "<attribute value>" or (hbnb) <class>.update(<id>, <attribute name>, "<attribute value>")

Interactive mode (example)

$ ./console.py
(hbnb) help

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

(hbnb)
(hbnb)
(hbnb) quit
$

Non-interactive mode (example)

$ 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 📏

Unittests for the HolbertonBnB project are defined in the [tests] To run the entire test suite simultaneously, execute the following command:

$ python3 unittest -m discover tests

Alternatively, you can specify a single test file to run at a time:

$ python3 unittest -m tests/test_console.py

About

A command interpreter to manipulate data without a visual interface, like in a Shell (perfect for development and debugging)


Languages

Language:Python 81.7%Language:HTML 11.2%Language:CSS 7.1%