TestCenter Reference
TestSupport.TestHelper.TestHelper Class Reference

Singleton for important helper facilities for the different tests. More...

Public Member Functions

def __new__ (self, *args, **kargs)
 The new method. More...
 
def __init__ (self, *args, **kargs)
 The default constructor. More...
 
def getInstance (self, *args, **kargs)
 The default constructor. More...
 
def hasInstance (self)
 Check if an instance has been initialized. More...
 
def setPackageList (self, packageList)
 Set the list of available packages. More...
 
def getPackageList (self)
 Return the list of available packages. More...
 
def getGlobalContext (self)
 
def setTestCaseContext (self, ctx)
 Set the context of the test. More...
 
def setMacrosLogOnSuccess (self, macrosLogOnSuccess)
 
def getMacrosLogOnSuccess (self)
 
def getTestCaseContext (self)
 Get the context of the test. More...
 
def getHelperContext (self)
 
def getResultDirectory (self)
 
def setModuleName (self, moduleName)
 
def getModuleName (self)
 
def setTestCaseName (self, testCaseName)
 
def getTestCaseName (self)
 
def setTestCaseDataDirectory (self, testCaseDataPath)
 
def getTestCaseDataDirectory (self)
 
def setTestCaseResultDirectory (self, testCaseName, functionName)
 
def getTestCaseResultDirectory (self)
 
def pushChangeSet (self)
 Push a new ChangeSet to the stack. More...
 
def popChangeSet (self)
 Pop a ChangeSet from the stack and delete it. More...
 
def clearChangeSet (self)
 Clear the change set stakc without restoring the field values. More...
 
def getChangeSet (self)
 Return the ChangeSet on top of the stack. More...
 
def getChangeSetStackLength (self)
 Get the length of the ChangeSet stack. More...
 
def runTestInCurrentMlabInstance (self)
 Set if tests are not run in secure mode. More...
 
def runTestInSecureMode (self)
 Set if tests are run in secure mode. More...
 
def testIsRunInSecureMode (self)
 Check if tests are run in secure mode. More...
 
def setLogHandler (self, logHandler)
 Set the current log handler. More...
 
def unsetLogHandler (self)
 Unset the current log handler. More...
 
def getLogHandler (self)
 Get the current log handler. More...
 
def setCallerStackFrame (self, stackFrame)
 
def getCallerStackFrame (self)
 
def hasCallerStackFrame (self)
 
def resetCallerStackFrame (self)
 
def addExtraTestCaseResult (self, extraTestCaseResult)
 
def takeExtraTestCaseResults (self)
 
def pushEnvironment (self)
 Pushes the current environment to the stack. More...
 
def popEnvironment (self)
 Pops an environment dictionary from the stack and makes it the current environment. More...
 

Detailed Description

Singleton for important helper facilities for the different tests.

Warning
Please note: This is internal stuff and should not be used in tests! The functionality is provided through the TestSupport package.

Definition at line 298 of file TestHelper.py.

Constructor & Destructor Documentation

◆ __init__()

def 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.

Member Function Documentation

◆ __new__()

def TestSupport.TestHelper.TestHelper.__new__ (   self,
args,
**  kargs 
)

The new method.

Definition at line 350 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper.getInstance().

◆ addExtraTestCaseResult()

def TestSupport.TestHelper.TestHelper.addExtraTestCaseResult (   self,
  extraTestCaseResult 
)

◆ clearChangeSet()

def 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().

◆ getCallerStackFrame()

def TestSupport.TestHelper.TestHelper.getCallerStackFrame (   self)

Definition at line 626 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mStackFrame.

◆ getChangeSet()

def 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.

◆ getChangeSetStackLength()

def TestSupport.TestHelper.TestHelper.getChangeSetStackLength (   self)

Get the length of the ChangeSet stack.

Returns
Length of the stack.

Definition at line 573 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mChangeSetStack.

◆ getGlobalContext()

def TestSupport.TestHelper.TestHelper.getGlobalContext (   self)

Definition at line 429 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mCtx.

◆ getHelperContext()

def TestSupport.TestHelper.TestHelper.getHelperContext (   self)

Definition at line 463 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mHelperModule.

◆ getInstance()

◆ getLogHandler()

def TestSupport.TestHelper.TestHelper.getLogHandler (   self)

Get the current log handler.

This returns None if no log handler is set!

Returns
The current log handler.

Definition at line 618 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mLogHandler.

◆ getMacrosLogOnSuccess()

def TestSupport.TestHelper.TestHelper.getMacrosLogOnSuccess (   self)

◆ getModuleName()

def TestSupport.TestHelper.TestHelper.getModuleName (   self)

Definition at line 481 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mModuleName.

◆ getPackageList()

def TestSupport.TestHelper.TestHelper.getPackageList (   self)

Return the list of available packages.

Definition at line 423 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mPackageList.

◆ getResultDirectory()

def TestSupport.TestHelper.TestHelper.getResultDirectory (   self)

◆ getTestCaseContext()

def TestSupport.TestHelper.TestHelper.getTestCaseContext (   self)

Get the context of the test.

Definition at line 457 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mTestCaseContext.

◆ getTestCaseDataDirectory()

def TestSupport.TestHelper.TestHelper.getTestCaseDataDirectory (   self)

◆ getTestCaseName()

def TestSupport.TestHelper.TestHelper.getTestCaseName (   self)

Definition at line 493 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mTestCaseName.

◆ getTestCaseResultDirectory()

def TestSupport.TestHelper.TestHelper.getTestCaseResultDirectory (   self)

◆ hasCallerStackFrame()

def TestSupport.TestHelper.TestHelper.hasCallerStackFrame (   self)

Definition at line 629 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mStackFrame.

◆ hasInstance()

def 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.

◆ popChangeSet()

def TestSupport.TestHelper.TestHelper.popChangeSet (   self)

Pop a ChangeSet from the stack and delete it.

Deleting a ChangeSet will revert the changes.

Returns
True if deleting the ChangeSet succeeded.

Definition at line 539 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mChangeSetStack.

Referenced by TestSupport.TestHelper.TestHelper.clearChangeSet().

◆ popEnvironment()

def TestSupport.TestHelper.TestHelper.popEnvironment (   self)

Pops an environment dictionary from the stack and makes it the current environment.

Returns
True if an environment dictionary was removed from the stack.

Definition at line 660 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mEnvironmentStack.

◆ pushChangeSet()

def TestSupport.TestHelper.TestHelper.pushChangeSet (   self)

Push a new ChangeSet to the stack.

Returns
The length of the ChangeSet stack.

Definition at line 529 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mChangeSetStack, and TestSupport.TestHelper.TestHelper._mTestCaseContext.

◆ pushEnvironment()

def 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.

◆ resetCallerStackFrame()

def TestSupport.TestHelper.TestHelper.resetCallerStackFrame (   self)

Definition at line 632 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mStackFrame.

◆ runTestInCurrentMlabInstance()

def TestSupport.TestHelper.TestHelper.runTestInCurrentMlabInstance (   self)

Set if tests are not run in secure mode.

Definition at line 580 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mSecureTesting.

◆ runTestInSecureMode()

def 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.

◆ setCallerStackFrame()

def TestSupport.TestHelper.TestHelper.setCallerStackFrame (   self,
  stackFrame 
)

Definition at line 623 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mStackFrame.

◆ setLogHandler()

def 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.

◆ setMacrosLogOnSuccess()

def TestSupport.TestHelper.TestHelper.setMacrosLogOnSuccess (   self,
  macrosLogOnSuccess 
)

◆ setModuleName()

def TestSupport.TestHelper.TestHelper.setModuleName (   self,
  moduleName 
)

Definition at line 475 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mModuleName.

◆ setPackageList()

def 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.

◆ setTestCaseContext()

def TestSupport.TestHelper.TestHelper.setTestCaseContext (   self,
  ctx 
)

◆ setTestCaseDataDirectory()

def TestSupport.TestHelper.TestHelper.setTestCaseDataDirectory (   self,
  testCaseDataPath 
)

◆ setTestCaseName()

def TestSupport.TestHelper.TestHelper.setTestCaseName (   self,
  testCaseName 
)

Definition at line 487 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mTestCaseName.

◆ setTestCaseResultDirectory()

def TestSupport.TestHelper.TestHelper.setTestCaseResultDirectory (   self,
  testCaseName,
  functionName 
)

◆ takeExtraTestCaseResults()

def TestSupport.TestHelper.TestHelper.takeExtraTestCaseResults (   self)

◆ testIsRunInSecureMode()

def 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.

◆ unsetLogHandler()

def TestSupport.TestHelper.TestHelper.unsetLogHandler (   self)

Unset the current log handler.

Definition at line 609 of file TestHelper.py.

References TestSupport.TestHelper.TestHelper._mLogHandler.


The documentation for this class was generated from the following file: