AirBnB Clone Phase #3

Description

Project attempts to clone the the AirBnB application and website, including the database, storage, RESTful API, Web Framework, and Front End.

Environment

  • OS: Ubuntu 14.04 LTS
  • language: Python 3.4.3
  • style: PEP 8 (v. 1.7.0)

Testing

unittest

This project uses python library, unittest to run tests on all python files. All unittests are in the ./tests directory with the command:

  • python3 -m unittest discover -v ./tests/

The bash script init_test.sh executes all these tests:

  • checks pep8 style

  • runs all unittests

  • runs all w3c_validator tests

  • cleans up all __pycache__ directories and the storage file, file.json

Usage:

$ ./dev/init_test.sh

CLI Interactive Tests

This project uses python library, cmd to run tests in an interactive command line interface. To begin tests with the CLI, run this script:

$ ./console.py
  • For a detailed description of all tests, run these commands inside the custom CLI:
$ ./console.py
(hbnb) help help
List available commands with "help" or detailed help with "help cmd".
(hbnb) help

Documented commands (type help <topic>):
========================================
Amenity    City  Place   State  airbnb  create   help  show
BaseModel  EOF   Review  User   all     destroy  quit  update

(hbnb) help User
class method with .function() syntax
        Usage: User.<command>(<id>)
(hbnb) help create
create: create [ARG]
        ARG = Class Name
        SYNOPSIS: Creates a new instance of the Class from given input ARG
  • Tests in the CLI may also be executed with this syntax:

    • destroy: <class name>.destroy(<id>)

    • update: <class name>.update(<id>, <attribute name>, <attribute value>)

    • update with dictionary: <class name>.update(<id>, <dictionary representation>)

Continuous Integration

Uses Travis-CI to run all tests on all commits to the github repo

Authors

License

Public Domain, no copyright protection