Testing

modpipe.test – Test framework

This module provides classes that are useful for writing unit tests for ModPipe functionality, and is used by ModPipe’s internal test suite.

class modpipe.test.TestCase(methodName='runTest')
get_modpipe_binary_path(binary)

Get the full path to a ModPipe binary (e.g. main/BenchMark.pl).

require_clean_exit(popen)

Raise an error if a subprocess exits with a non-zero return code.

run_binary(binary, args)

Run a binary and require it to exit with status 0.

run_perl_code(code)

Run a short snippet of Perl code

run_script(dir, script, args)

Run a ModPipe script (a module in modpipe.dir), as if run from the command line, passing the given command line arguments. The script’s stderr is redirected to stdout, so as not to clutter the test output.