Download tut from ftp://ftp.reahl.org/tut

Tut

Introduction

Tut is a tiny package with test utilities used in-house. You will have to look at the code for the details, this document just gives a very basic overview of what's in there.

Features

Asserting

The most-used feature of tut is its verbose assert function, called vassert. The idea is that you should be able to code an assertion like this:

tut.vassert( itemCount == expectedCount )

If the expression fails, vassert will raise an AssertionError which can be viewed in a stacktrace as follows:

AssertionError: tut.vassert( itemCount == expectedCount )

      ----- values were -----
      itemCount: 1
      expectedCount: 2

The module tut.assert contains a few other methods related to checking for exceptions. Please look at the code for details.

Temporary files and directories

The module tut.files contains a number of classes and utility functions for creating temporary files and directories.

These allow you to create temporary files with content, or to create temporary files inside temporary directories, etc.

All created files are done using the standard Python tempfile module. Please see the code for details.