The Python libraries come with two ways of writing unittests: module unittest, and module doctest. In some cases, unittest is more natural (less cumbersome) than doctest. Wrote tests on xmlWriter for illustration.
What it is ?
Quoting from TTX/FontTools Sourceforge Project
a tool to convert OpenType and TrueType fonts to and from XML. FontTools is a library for manipulating fonts, written in Python. It supports TrueType, OpenType, AFM and to an extent Type 1 and some Mac-specific formats.
Quick start
python setup.py install
From your command line type the above command to get fontools installed on your system.
Installation
See install.txt in the 'Doc' subdirectory for instructions on how to build and install TTX/FontTools from the sources.
Documentation
What is TTX ?
See documentation.html in the "Doc" subdirectory for TTX usage instructions and information about the TTX file format.
History
The fontTools project was started by Just van Rossum in 1999, and was maintained as an open source project at http://sourceforge.net/projects/fonttools/. In 2008, Paul Wise (pabs3) began helping Just with stability maintenance. In 2013 Behdad Esfahbod began a friendly fork, thoroughly reviewing the codebase and making changes at https://github.com/behdad/fonttools to add new features and support for new font formats.
Community
License
See "LICENSE.txt" for licensing information.
Have fun!
Just van Rossum just@letterror.com