Getting started

Working on mimic requires the installation of a small number of development dependencies, which are listed in dev-requirements.txt. They can be installed in a virtualenv using pip. This also installs mimic in editable mode.

For example:

$ # Create a virtualenv and activate it
$ pip install --requirement dev-requirements.txt

You are now ready to run the tests and build the documentation.

Some of the tox jobs may require certain packages to be installed, so having homebrew installed would be useful if developing on Mac OS.

Running tests

mimic unit tests are found in the mimic/test/ directory. They are written as Twisted tests and can be run either with Twisted’s trial or with unittest2.

$ trial mimic

Or

$ python -m unittest discover

You can also check test coverage by using the coverage tool:

$ coverage run `which trial` mimic

Or

$ coverage run -m unittest discover

You can also run the tests for other python interpreters. We use tox, which creates a virtualenv per tox job to run tests, linting, etc.:

$ tox
...
 py26: commands succeeded
 py27: commands succeeded
 pypy: commands succeeded
 docs: commands succeeded
 lint: commands succeeded

Building documentation

mimic documentation is stored in the docs/ directory. It is written in reStructured Text and rendered using Sphinx.

To build the documentation, run sphinx:

$ sphinx-build -W -b html -d _tmp/doctrees docs docs/_build/html

The HTML documentation index can now be found at docs/_build/html/index.html.

Alternately, you can use our tox job:

$ tox -e docs