ptestlib | index /home/pfeiffer/project-shared/publicize/bii_scripts-top/bii_scripts/lib/python/bii_scripts/ptestlib.py |
a module providing routines for doctest testcode.
This module provides functions that are useful if doctest
testcode becomes a bit more complicated.
Here is a list of functions:
inittestdir -- set up a directory for tests. This is needed
if files are created by the testcode. The test directory
can be removed later with cleanuptestdir()
testdir -- return the name of the test-directory that was created
as a complete path.
pjoin -- this simply calls os.path.join, it joins a list of
strings to a complete path.
tjoin -- this returns pjoin(testdirname(),<args>), it joins
strings to a complete path, prepending the name
of the test directory.
mkdir -- this creates a new sub-directory within the test
directory.
rename -- this renames a file or directory within the test
directory.
mkfile -- creates a file with arbitrary text in the test
directory.
catfile -- print the contents of a file to the console.
rewritefile -- rewrites a file in the test directory with
arbitrary text
rm_rf -- recursively delete a directory or file in the
test directory
cleanuptestdir -- remove the test directory and all it's contents
dictprint -- print a dictionary in a sorted way
matches -- test if a string matches a regular expression
system -- execute a system command and possibly return
it's output
msg -- print a message to the user by writing to stderr. This
message can be seen on the terminal while the testcode
is executed.
Modules | ||||||
|
Functions | ||
|
Data | ||
testdir = None tmpdir = '/tmp' |