Testing Utilities¶
Summary¶
This page will provide developers with details of testing utilities, such as helper files, which are useful in creating unit tests.
Helper Functions¶
C++¶
The following helper files have been found in the Mantid/Framework/TestHelpers package:
ComponentCreationHelper ComponentCreationHelper This creates instrument components that can then be used in a unit test.
ICatTestHelper
ScopedFileHelper This creates a file that is automatically deleted when no longer needed.
WorkspaceCreationHelper This creates simple workspaces that can be used in a unit test. One of these workspaces has a full instrument.
Python¶
There are some testhelpers
which are only available in Python, they can
be found in the testhelpers
-package.
make_decorator
- A function that returns a decorator for an algorithm without executing it.TemporaryFileHelper
- A class that creates named temporary files and deletes them automatically when the object is deleted. Basically a thin wrapper around NamedTemporaryFile from the tempfile package.mtd.unique_name
andmtd.unique_hidden_name
- functions that allow you to create a workspace name that will beunique to avoid colisions with other workspaces. This is useful for testing and temporary workspaces.