Base Case Example for How to Test a Python Class

Start in a directory and create a file called test_calculator.py and put the contents:

From there you can get the tests passing by creating a file called calculator.py with the contents:

Now you can simply run the command: python test_calculator.py and it will run the test and give you the output. For more complex TDD scenarios you might also want to look into tools such as nosetests