wuttjamaican.testing

WuttJamaican - test utilities

class wuttjamaican.testing.FileConfigTestCase(methodName='runTest')[source]

Common base class for test suites which write temporary files, for sake of testing the config constructor etc.

This inherits from unittest.TestCase and adds the following features:

Creates a temporary folder on setup, and removes it on teardown. Adds the write_file() method to help with creating temporary files.

tempdir

Path to the temporary folder created during setup.

setup_file_config()[source]

Setup logic specific to the FileConfigTestCase.

This creates the temporary folder.

teardown_file_config()[source]

Teardown logic specific to the FileConfigTestCase.

This removes the temporary folder.

write_file(filename, content)[source]

Write a new file (in temporary folder) with the given filename and content, and return its full path. For instance:

myconf = self.write_file('my.conf', '<file contents>')