Plugin base class to simplify implementation. More...
Public Member Functions | |
def | __init__ |
Mandatory and is called once for every sequence of steps to execute. More... | |
def | add_options |
Used to add custom command line options. More... | |
def | setup |
Called during Step.SETUP step. More... | |
def | run |
Called during Step.RUN step. More... | |
def | teardown |
Called during Step.TEARDOWN. More... | |
Static Public Attributes | |
int | order = 200 |
Plugin base class to simplify implementation.
class attributes: order used to order the plugin execution order in each step, low value = earlier execution.
The step methods Plugin.setup
, Plugin.run
, Plugin.teardown
shall only assume that Plugin.__init__
has been called previously. This is because the user may choose to only execute parts of the full test sequence, most often to repeateadly execute the Steps.RUN step. The methods need to implement graceful error handling to handle missing steps.
def etr.plugin.Plugin.__init__ | ( | self, | |
ctx | |||
) |
Mandatory and is called once for every sequence of steps to execute.
def etr.plugin.Plugin.add_options | ( | cls, | |
parser | |||
) |
Used to add custom command line options.
def etr.plugin.Plugin.run | ( | self, | |
ctx | |||
) |
Called during Step.RUN step.
State and data from previous steps must be loaded from ctx.env
or ctx.storage
.
ctx.env
shall be considered read-only. Changes will not persist.
def etr.plugin.Plugin.setup | ( | self, | |
ctx | |||
) |
Called during Step.SETUP step.
Any state or data needed in the following steps shall be stored persistantly using the key-value store in ctx.storage
or by modifying the ctx.env
dictionary.
def etr.plugin.Plugin.teardown | ( | self, | |
ctx | |||
) |
Called during Step.TEARDOWN.
State and data from previous steps must be loaded from ctx.env
, or ctx.storage
.
ctx.env
shall be considered read-only. Changes will not persist.
|
static |