|
TestCenter Reference
|
Singleton for important helper facilities for the different tests. More...
Public Member Functions | |
| __new__ (self, *args, **kargs) | |
| The new method. | |
| __init__ (self, *args, **kargs) | |
| The default constructor. | |
| getInstance (self, *args, **kargs) | |
| The default constructor. | |
| hasInstance (self) | |
| Check if an instance has been initialized. | |
| setPackageList (self, packageList) | |
| Set the list of available packages. | |
| getPackageList (self) | |
| Return the list of available packages. | |
| getGlobalContext (self) | |
| setTestCaseContext (self, ctx) | |
| Set the context of the test. | |
| setMacrosLogOnSuccess (self, macrosLogOnSuccess) | |
| getMacrosLogOnSuccess (self) | |
| getTestCaseContext (self) | |
| Get the context of the test. | |
| getHelperContext (self) | |
| getResultDirectory (self) | |
| setModuleName (self, moduleName) | |
| getModuleName (self) | |
| setTestCaseName (self, testCaseName) | |
| getTestCaseName (self) | |
| setTestCaseDataDirectory (self, testCaseDataPath) | |
| getTestCaseDataDirectory (self) | |
| setTestCaseResultDirectory (self, testCaseName, functionName) | |
| getTestCaseResultDirectory (self) | |
| pushChangeSet (self) | |
| Push a new ChangeSet to the stack. | |
| popChangeSet (self) | |
| Pop a ChangeSet from the stack and delete it. | |
| clearChangeSet (self) | |
| Clear the change set stakc without restoring the field values. | |
| getChangeSet (self) | |
| Return the ChangeSet on top of the stack. | |
| getChangeSetStackLength (self) | |
| Get the length of the ChangeSet stack. | |
| runTestInCurrentMlabInstance (self) | |
| Set if tests are not run in secure mode. | |
| runTestInSecureMode (self) | |
| Set if tests are run in secure mode. | |
| testIsRunInSecureMode (self) | |
| Check if tests are run in secure mode. | |
| setLogHandler (self, logHandler) | |
| Set the current log handler. | |
| unsetLogHandler (self) | |
| Unset the current log handler. | |
| getLogHandler (self) | |
| Get the current log handler. | |
| setCallerStackFrame (self, stackFrame) | |
| getCallerStackFrame (self) | |
| hasCallerStackFrame (self) | |
| resetCallerStackFrame (self) | |
| addExtraTestCaseResult (self, extraTestCaseResult) | |
| takeExtraTestCaseResults (self) | |
| pushEnvironment (self) | |
| Pushes the current environment to the stack. | |
| popEnvironment (self) | |
| Pops an environment dictionary from the stack and makes it the current environment. | |
Protected Attributes | |
| _mChangeSet | |
| _mMacrosLogOnSuccess | |
| _mSecureTesting | |
Static Protected Attributes | |
| _mCtx = None | |
| The global context. | |
| _mTestCaseContext = None | |
| The current test's context. | |
| _mHelperModule = None | |
| The context of the helper module. | |
| _mResultDirectory = None | |
| The directory used to save results. | |
| _mPackageList = None | |
| The list of packages that should be assumed to be available. | |
| _mTestCaseName = None | |
| The name of the current test case. | |
| _mModuleName = None | |
| The name of the currently tested module. | |
| _mTestCaseDataDirectory = None | |
| The path to the test case data. | |
| _mTestCaseResultDirectory = None | |
| The path to the results. | |
| _mChangeSetStack = None | |
| A stack of ChangeSets used to revert changes to field values. | |
| bool | _mSecureTesting = False |
| Allow checking, whether tests are run in secure mode. | |
| _mLogHandler = None | |
| The log handler that can be used to handle the reports. | |
| _mStackFrame = None | |
| The stack frame of the calling function that is used when logging events. | |
| _mEnvironmentStack = None | |
| A stack of environment dictionaries used to revert changes to the environment. | |
| _mExtraTestCaseResults = None | |
| A list of extra test case results. | |
| bool | _mMacrosLogOnSuccess = True |
| This is the default value for the 'logOnSuccess' parameter (if it is None) of the ASSERT_*/EXPECT_* macros. | |
Singleton for important helper facilities for the different tests.
Definition at line 298 of file TestHelper.py.
| TestSupport.TestHelper.TestHelper.__init__ | ( | self, | |
| * | args, | ||
| ** | kargs ) |
The default constructor.
Do nothing in here as construction must be done in the getInstance methode.
Definition at line 359 of file TestHelper.py.
| TestSupport.TestHelper.TestHelper.__new__ | ( | self, | |
| * | args, | ||
| ** | kargs ) |
The new method.
Definition at line 350 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper.getInstance().
| TestSupport.TestHelper.TestHelper.addExtraTestCaseResult | ( | self, | |
| extraTestCaseResult ) |
Definition at line 636 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mExtraTestCaseResults.
Referenced by TestCenterAdvanced.TestCase.TestCase.run().
| TestSupport.TestHelper.TestHelper.clearChangeSet | ( | self | ) |
Clear the change set stakc without restoring the field values.
Definition at line 552 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mChangeSetStack, and TestSupport.TestHelper.TestHelper.popChangeSet().
| TestSupport.TestHelper.TestHelper.getCallerStackFrame | ( | self | ) |
Definition at line 626 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mStackFrame.
| TestSupport.TestHelper.TestHelper.getChangeSet | ( | self | ) |
Return the ChangeSet on top of the stack.
Definition at line 562 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mChangeSetStack.
| TestSupport.TestHelper.TestHelper.getChangeSetStackLength | ( | self | ) |
Get the length of the ChangeSet stack.
Definition at line 573 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mChangeSetStack.
| TestSupport.TestHelper.TestHelper.getGlobalContext | ( | self | ) |
Definition at line 429 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mCtx.
| TestSupport.TestHelper.TestHelper.getHelperContext | ( | self | ) |
Definition at line 463 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mHelperModule.
| TestSupport.TestHelper.TestHelper.getInstance | ( | self, | |
| * | args, | ||
| ** | kargs ) |
The default constructor.
Static method to have a reference to **THE UNIQUE** instance
Definition at line 367 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper.__instance, TestSupport.TestHelper.TestHelper.__lockObj, TestSupport.TestHelper.TestHelper._mChangeSetStack, TestSupport.TestHelper.TestHelper._mCtx, TestSupport.TestHelper.TestHelper._mEnvironmentStack, TestSupport.TestHelper.TestHelper._mHelperModule, and TestSupport.TestHelper.TestHelper._mResultDirectory.
Referenced by TestSupport.TestHelper.TestHelper.__new__().
| TestSupport.TestHelper.TestHelper.getLogHandler | ( | self | ) |
Get the current log handler.
This returns None if no log handler is set!
Definition at line 618 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mLogHandler.
| TestSupport.TestHelper.TestHelper.getMacrosLogOnSuccess | ( | self | ) |
Definition at line 450 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mMacrosLogOnSuccess.
| TestSupport.TestHelper.TestHelper.getModuleName | ( | self | ) |
Definition at line 481 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mModuleName.
| TestSupport.TestHelper.TestHelper.getPackageList | ( | self | ) |
Return the list of available packages.
Definition at line 423 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mPackageList.
| TestSupport.TestHelper.TestHelper.getResultDirectory | ( | self | ) |
Definition at line 469 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mResultDirectory.
Referenced by TestSupport.TestHelper.TestHelper.setTestCaseResultDirectory().
| TestSupport.TestHelper.TestHelper.getTestCaseContext | ( | self | ) |
Get the context of the test.
Definition at line 457 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mTestCaseContext.
| TestSupport.TestHelper.TestHelper.getTestCaseDataDirectory | ( | self | ) |
Definition at line 505 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mTestCaseDataDirectory.
| TestSupport.TestHelper.TestHelper.getTestCaseName | ( | self | ) |
Definition at line 493 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mTestCaseName.
| TestSupport.TestHelper.TestHelper.getTestCaseResultDirectory | ( | self | ) |
Definition at line 519 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mTestCaseResultDirectory.
| TestSupport.TestHelper.TestHelper.hasCallerStackFrame | ( | self | ) |
Definition at line 629 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mStackFrame.
| TestSupport.TestHelper.TestHelper.hasInstance | ( | self | ) |
Check if an instance has been initialized.
Definition at line 409 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper.__instance.
| TestSupport.TestHelper.TestHelper.popChangeSet | ( | self | ) |
Pop a ChangeSet from the stack and delete it.
Deleting a ChangeSet will revert the changes.
Definition at line 539 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mChangeSetStack.
Referenced by TestSupport.TestHelper.TestHelper.clearChangeSet().
| TestSupport.TestHelper.TestHelper.popEnvironment | ( | self | ) |
Pops an environment dictionary from the stack and makes it the current environment.
Definition at line 660 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mEnvironmentStack.
| TestSupport.TestHelper.TestHelper.pushChangeSet | ( | self | ) |
Push a new ChangeSet to the stack.
Definition at line 529 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mChangeSetStack, and TestSupport.TestHelper.TestHelper._mTestCaseContext.
| TestSupport.TestHelper.TestHelper.pushEnvironment | ( | self | ) |
Pushes the current environment to the stack.
Definition at line 651 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mEnvironmentStack.
| TestSupport.TestHelper.TestHelper.resetCallerStackFrame | ( | self | ) |
Definition at line 632 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mStackFrame.
| TestSupport.TestHelper.TestHelper.runTestInCurrentMlabInstance | ( | self | ) |
Set if tests are not run in secure mode.
Definition at line 580 of file TestHelper.py.
| TestSupport.TestHelper.TestHelper.runTestInSecureMode | ( | self | ) |
Set if tests are run in secure mode.
Definition at line 587 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mSecureTesting.
| TestSupport.TestHelper.TestHelper.setCallerStackFrame | ( | self, | |
| stackFrame ) |
Definition at line 623 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mStackFrame.
| TestSupport.TestHelper.TestHelper.setLogHandler | ( | self, | |
| logHandler ) |
Set the current log handler.
@params logHandler The current log handler.
Definition at line 602 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mLogHandler.
| TestSupport.TestHelper.TestHelper.setMacrosLogOnSuccess | ( | self, | |
| macrosLogOnSuccess ) |
Definition at line 444 of file TestHelper.py.
| TestSupport.TestHelper.TestHelper.setModuleName | ( | self, | |
| moduleName ) |
Definition at line 475 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mModuleName.
| TestSupport.TestHelper.TestHelper.setPackageList | ( | self, | |
| packageList ) |
Set the list of available packages.
Definition at line 416 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mPackageList.
| TestSupport.TestHelper.TestHelper.setTestCaseContext | ( | self, | |
| ctx ) |
Set the context of the test.
Definition at line 436 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mTestCaseContext.
| TestSupport.TestHelper.TestHelper.setTestCaseDataDirectory | ( | self, | |
| testCaseDataPath ) |
Definition at line 499 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mTestCaseDataDirectory.
| TestSupport.TestHelper.TestHelper.setTestCaseName | ( | self, | |
| testCaseName ) |
Definition at line 487 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mTestCaseName.
| TestSupport.TestHelper.TestHelper.setTestCaseResultDirectory | ( | self, | |
| testCaseName, | |||
| functionName ) |
Definition at line 511 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mTestCaseResultDirectory, and TestSupport.TestHelper.TestHelper.getResultDirectory().
| TestSupport.TestHelper.TestHelper.takeExtraTestCaseResults | ( | self | ) |
Definition at line 642 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mExtraTestCaseResults.
| TestSupport.TestHelper.TestHelper.testIsRunInSecureMode | ( | self | ) |
Check if tests are run in secure mode.
Definition at line 594 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mSecureTesting.
| TestSupport.TestHelper.TestHelper.unsetLogHandler | ( | self | ) |
Unset the current log handler.
Definition at line 609 of file TestHelper.py.
References TestSupport.TestHelper.TestHelper._mLogHandler.
|
protected |
Definition at line 438 of file TestHelper.py.
|
staticprotected |
A stack of ChangeSets used to revert changes to field values.
Definition at line 322 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.clearChangeSet(), TestSupport.TestHelper.TestHelper.getChangeSet(), TestSupport.TestHelper.TestHelper.getChangeSetStackLength(), TestSupport.TestHelper.TestHelper.getInstance(), TestSupport.TestHelper.TestHelper.popChangeSet(), and TestSupport.TestHelper.TestHelper.pushChangeSet().
|
staticprotected |
The global context.
Definition at line 301 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getGlobalContext(), and TestSupport.TestHelper.TestHelper.getInstance().
|
staticprotected |
A stack of environment dictionaries used to revert changes to the environment.
Definition at line 334 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getInstance(), TestSupport.TestHelper.TestHelper.popEnvironment(), and TestSupport.TestHelper.TestHelper.pushEnvironment().
|
staticprotected |
A list of extra test case results.
Definition at line 337 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.addExtraTestCaseResult(), and TestSupport.TestHelper.TestHelper.takeExtraTestCaseResults().
|
staticprotected |
The context of the helper module.
Definition at line 305 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getHelperContext(), and TestSupport.TestHelper.TestHelper.getInstance().
|
staticprotected |
The log handler that can be used to handle the reports.
Definition at line 328 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getLogHandler(), TestSupport.TestHelper.TestHelper.setLogHandler(), and TestSupport.TestHelper.TestHelper.unsetLogHandler().
|
staticprotected |
This is the default value for the 'logOnSuccess' parameter (if it is None) of the ASSERT_*/EXPECT_* macros.
Definition at line 340 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getMacrosLogOnSuccess().
|
protected |
Definition at line 445 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getMacrosLogOnSuccess().
|
staticprotected |
The name of the currently tested module.
Definition at line 314 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getModuleName(), and TestSupport.TestHelper.TestHelper.setModuleName().
|
staticprotected |
The list of packages that should be assumed to be available.
Definition at line 309 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getPackageList(), and TestSupport.TestHelper.TestHelper.setPackageList().
|
staticprotected |
The directory used to save results.
Definition at line 307 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getInstance(), and TestSupport.TestHelper.TestHelper.getResultDirectory().
|
staticprotected |
Allow checking, whether tests are run in secure mode.
Definition at line 325 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.runTestInSecureMode(), and TestSupport.TestHelper.TestHelper.testIsRunInSecureMode().
|
protected |
Definition at line 581 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.runTestInSecureMode(), and TestSupport.TestHelper.TestHelper.testIsRunInSecureMode().
|
staticprotected |
The stack frame of the calling function that is used when logging events.
Definition at line 331 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getCallerStackFrame(), TestSupport.TestHelper.TestHelper.hasCallerStackFrame(), TestSupport.TestHelper.TestHelper.resetCallerStackFrame(), and TestSupport.TestHelper.TestHelper.setCallerStackFrame().
|
staticprotected |
The current test's context.
Definition at line 303 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getTestCaseContext(), TestSupport.TestHelper.TestHelper.pushChangeSet(), and TestSupport.TestHelper.TestHelper.setTestCaseContext().
|
staticprotected |
The path to the test case data.
Definition at line 317 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getTestCaseDataDirectory(), and TestSupport.TestHelper.TestHelper.setTestCaseDataDirectory().
|
staticprotected |
The name of the current test case.
Definition at line 312 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getTestCaseName(), and TestSupport.TestHelper.TestHelper.setTestCaseName().
|
staticprotected |
The path to the results.
Definition at line 319 of file TestHelper.py.
Referenced by TestSupport.TestHelper.TestHelper.getTestCaseResultDirectory(), and TestSupport.TestHelper.TestHelper.setTestCaseResultDirectory().