wuttjamaican.testing
¶
WuttJamaican - test utilities
- class wuttjamaican.testing.ConfigTestCase(methodName='runTest')[source]¶
Base class for test suites requiring a config object.
It inherits from
FileTestCase
so also has the file-related methods.The running test has these attributes:
- config¶
Reference to the config object.
- app¶
Reference to the app handler.
Note
If you subclass this directly and need to override setup/teardown, please be sure to call the corresponding methods for this class.
- class wuttjamaican.testing.DataTestCase(methodName='runTest')[source]¶
Base class for test suites requiring a full (typical) database.
It inherits from
FileTestCase
so also has the file-related methods.This uses a SQLite in-memory database and creates all tables for the app model. The running test has these attributes:
- config¶
Reference to the config object.
- app¶
Reference to the app handler.
- session¶
Open session for the test DB.
Note
If you subclass this and need to override setup/teardown, please be sure to call the corresponding methods for this class.
However you do not need to call the file-related setup or teardown methods, as this class handles that automatically.
- wuttjamaican.testing.FileConfigTestCase¶
alias of
FileTestCase
- class wuttjamaican.testing.FileTestCase(methodName='runTest')[source]¶
Base class for test suites which (may) write temporary files, for sake of testing the config constructor etc. It inherits from
unittest.TestCase
.This class creates a temporary folder on setup, and removes it on teardown. See below for features exposed to work with the folder.
- tempdir¶
Path to the temporary folder created during setup.
Note
If you subclass this and need to override setup/teardown, please be sure to call the corresponding methods for this class.