A skeleton Python unit test to boot-strap projects.
Python
Switch branches/tags
Nothing to show
Latest commit 3484a4a Oct 15, 2013 Sean Reifschneider Adding 3.2 and 3.3 test options.
Permalink
Failed to load latest commit information.
tests Adding 3.2 and 3.3 test options. Oct 16, 2013
README.markdown
cli_skeleton Changing the structure of the CLI test. Aug 10, 2013

README.markdown

Python Unittest Skeleton

This is a skeleton Python unittest file to allow it to be grabbed and filled in, instead of having to remember the structure.

The "test_skeleton.py" is an example of standard Python tests.

The "test_bottle.py" is some test code for a Bottle web application.

The "cli_skeleton" is an example of testing a command-line application.

The "test_faketcpserver.py" includes sample code which uses the faketcpserver module, mentioned below, to test code reaction to misbehaving TCP servers.

"faketcpserver.py" has code to create a fake TCP server which you can provide a script to emulate certain send/receive/hangup behavior, to simulate a TCP server that misbehaes or disconnects. Examples are in "test_skeleton.py".

Usage

To use:

  • Check out repository.

  • Copy "tests/test_skeleton.py" into your "test" directory.

  • Rename "test_skeleton.py" to something more descriptive. (Note: It should keep the "test_" prefix, so that "make" will run the tests).

  • Edit this file and search for "XXX".

  • Copy "Makefile" into your tests directory. It should work without modification.

  • If you are doing bootle web development, copy "test_bottle.py" into your "tests" directory and rename it to something more useful.

  • If you have a CLI program, use the "cli_skeleton" in the top level directory instead.