pysys.launcher.console_make¶
Implements pysys.py make
to create new testcases.
DefaultTestMaker¶
-
class
pysys.launcher.console_make.
DefaultTestMaker
(name='make', **kwargs)[source]¶ Bases:
object
The default implementation of
pysys.py make
, which creates tests and other assets using templates configurable on a per-directory basis using<maker-template>
configuration inpysysdirconfig.xml
(and project) files.See Test Descriptors for information about how to configure templates.
A subclass can be specified in the project if further customization is required using:
<maker classname="myorg.MyTestMaker"/>
-
validateTestId
(parentDir, prefix, numericSuffix, **kwargs)[source]¶ This method can be overridden to provide customized validation of a proposed new test directory name, for example to prevent clashes with existing tests committed to version control.
The default implementation of this method does nothing.
If validation fails, an exception should be thrown. The method can propose a new numericSuffix that will be used instead (only if auto-generating the test id) by raising an
ProposeNewTestIdNumericSuffixException
exception.The command line option
--skipValidation
can be used to disable this checking, for example when disconnected from the network.- Parameters
parentDir (str) – The absolute path of the directory in which the test is to be created.
prefix (str) – The proposed test id, excluding any numeric suffix.
numericSuffix (str) – The numeric suffix (including padding), if any, or ‘’ if this is not a numeric test id.
- Raises
ProposeNewTestIdNumericSuffixException – If an alternative numeric suffix would be acceptable. This is used when auto-generating test ids.
Exception – If the specific test id is not acceptable.
-
ProposeNewTestIdNumericSuffixException¶
-
class
pysys.launcher.console_make.
ProposeNewTestIdNumericSuffixException
(reason, newNumericSuffix)[source]¶ Bases:
Exception
This exception should be thrown by
DefaultTestMaker.validateTestId
if the specific test id cannot be used but the validator can propose an acceptable numeric suffix to use instead, typically with a higher number to avoid conflicts with tests committed to version control elsewhere.- Parameters
reason (str) – The error message to use if not auto-generating a new id.
newNumericSuffix (int) – The new numeric suffix
LegacyConsoleMakeTestHelper¶
ConsoleMakeTestHelper¶
-
pysys.launcher.console_make.
ConsoleMakeTestHelper
¶ alias of
pysys.launcher.console_make.LegacyConsoleMakeTestHelper