TestCenter Reference
TestCenterAdvanced.TestCase.TestCase Class Reference

The superclass for the different test case categories. More...

Inheritance diagram for TestCenterAdvanced.TestCase.TestCase:
TestCenterAdvanced.TestCaseFunctional.FunctionalTestCase TestCenterAdvanced.TestCaseGeneric.GenericTestCase

Public Member Functions

 __init__ (self, testCaseName, isNewlyCreated=False)
 Initialize the test case.
 __del__ (self)
 destroyContext (self)
 activate (self)
 Registers the test case at the TestHelper.
 deactivate (self)
 Resets the test helper.
 setTestCaseListener (self, testCaseListener)
 addExtraTestCaseResult (self, extraTestCaseResult)
 callFieldValueTestCase (self, filename, testcase)
 Call the given field-value test case from the given field-value test case set.
 isValid (self)
 Return True if the loaded test case is syntactically valid and should be executable.
 hasNetwork (self)
 Return True if the test case has a network attached.
 networkFileName (self)
 Returns the absolute file name of the attached network or an empty string if no network is attached.
 openFiles (self)
 Open the files associated with the test case.
 openNetwork (self)
 Open the internal network of the test case.
 getType (self)
 Return the type of this test case (generic or functional).
 getModule (self)
 Return the module representing this test case, or None.
 getName (self)
 Return the name of the test case.
 getListOfTestFuncs (self)
 Get the list of test functions in this test.
 getPackage (self)
 Return the identifier of the package the test case is in.
 getTestCaseNode (self)
 Return the XML node with the test case's information.
 run (self, etree.Element resultNode)
 Run the test case and store results in the given xml data structure.
 getDocumentation (self, functionName)
 Get the documentation for the given test function.

Public Attributes

bool futureDone = False
 callFieldValueTestCase

Protected Member Functions

 _getTestCaseInfo (self, testCaseName)
 _getTestFunction (self, funcName)
 _loadScriptFile (self, filename)
 Load the test cases script file.
 _callGroupFunction (self, groupFunctionName)
 _callableFunctions (self)
 _buildVirtualFunctions (self, isNewlyCreated)
 Build an XML node with the virtual functions.

Protected Attributes

 _ctx = None
 _testCaseName = testCaseName
 _testHelper = TestHelper.getInstance()
 _dataDirectory = infoDict["dataDirectory"]

Detailed Description

The superclass for the different test case categories.

Definition at line 171 of file TestCase.py.

Constructor & Destructor Documentation

◆ __init__()

TestCenterAdvanced.TestCase.TestCase.__init__ ( self,
testCaseName,
isNewlyCreated = False )

Initialize the test case.

Parameters
testCaseNameThe name of the test case.
isNewlyCreatedIndicates if the test case is newly created to suppress the warning that no test functions exist.

Definition at line 174 of file TestCase.py.

◆ __del__()

TestCenterAdvanced.TestCase.TestCase.__del__ ( self)

Definition at line 316 of file TestCase.py.

References destroyContext().

Member Function Documentation

◆ _buildVirtualFunctions()

TestCenterAdvanced.TestCase.TestCase._buildVirtualFunctions ( self,
isNewlyCreated )
protected

Build an XML node with the virtual functions.

The result is an XML node that contains information on all virtual functions including the information on hierarchy i.e. which nodes are aggregated in a group. Returns a Boolean value stating success.

Definition at line 831 of file TestCase.py.

References __createFieldValueTestNode(), __createIterativeTestNode(), __createNormalTestNode(), __createTestGroupNode(), __createUnitTestWrapperNode(), __functionDict, TestCenterAdvanced.Master.Master.__xmlRoot, __xmlRoot, _callableFunctions(), _ctx, and getDocumentation().

◆ _callableFunctions()

TestCenterAdvanced.TestCase.TestCase._callableFunctions ( self)
protected

Definition at line 828 of file TestCase.py.

References _ctx.

Referenced by _buildVirtualFunctions().

◆ _callGroupFunction()

TestCenterAdvanced.TestCase.TestCase._callGroupFunction ( self,
groupFunctionName )
protected

◆ _getTestCaseInfo()

TestCenterAdvanced.TestCase.TestCase._getTestCaseInfo ( self,
testCaseName )
protected

Definition at line 313 of file TestCase.py.

◆ _getTestFunction()

TestCenterAdvanced.TestCase.TestCase._getTestFunction ( self,
funcName )
protected

◆ _loadScriptFile()

TestCenterAdvanced.TestCase.TestCase._loadScriptFile ( self,
filename )
protected

Load the test cases script file.

Parameters
filenameName of the script file to be loaded.

Definition at line 434 of file TestCase.py.

References _ctx, _testCaseName, TestCenterAdvanced.TestCase.LogCollectorBase._testHelper, and _testHelper.

◆ activate()

TestCenterAdvanced.TestCase.TestCase.activate ( self)

Registers the test case at the TestHelper.

Does not support recursive calls.

Definition at line 326 of file TestCase.py.

References _ctx, _dataDirectory, _testCaseName, TestCenterAdvanced.TestCase.LogCollectorBase._testHelper, and _testHelper.

Referenced by run().

◆ addExtraTestCaseResult()

TestCenterAdvanced.TestCase.TestCase.addExtraTestCaseResult ( self,
extraTestCaseResult )

◆ callFieldValueTestCase()

TestCenterAdvanced.TestCase.TestCase.callFieldValueTestCase ( self,
filename,
testcase )

Call the given field-value test case from the given field-value test case set.

This method is required as the FIELDVALUETEST test methods don't have a valid counterpart in the script file itself.

Parameters
filenameThe field-value test case set.
testcaseThe test case to be executed.

Definition at line 445 of file TestCase.py.

References __getFunctionInfo(), and _ctx.

◆ deactivate()

TestCenterAdvanced.TestCase.TestCase.deactivate ( self)

Resets the test helper.

Does not support recursive calls.

Definition at line 338 of file TestCase.py.

References TestCenterAdvanced.TestCase.LogCollectorBase._testHelper, and _testHelper.

Referenced by run().

◆ destroyContext()

TestCenterAdvanced.TestCase.TestCase.destroyContext ( self)

Definition at line 319 of file TestCase.py.

References _ctx.

Referenced by __del__(), and getTestCaseNode().

◆ getDocumentation()

TestCenterAdvanced.TestCase.TestCase.getDocumentation ( self,
functionName )

Get the documentation for the given test function.

The found string will be modified such that all trailing whitespace will be removed.

Parameters
functionNameThe function to gather documentation for.
Returns
The function's documentation.

Definition at line 1196 of file TestCase.py.

References _ctx.

Referenced by _buildVirtualFunctions(), and _callGroupFunction().

◆ getListOfTestFuncs()

TestCenterAdvanced.TestCase.TestCase.getListOfTestFuncs ( self)

Get the list of test functions in this test.

Definition at line 993 of file TestCase.py.

References __functionDict.

Referenced by run().

◆ getModule()

TestCenterAdvanced.TestCase.TestCase.getModule ( self)

Return the module representing this test case, or None.

Definition at line 985 of file TestCase.py.

References _ctx.

◆ getName()

TestCenterAdvanced.TestCase.TestCase.getName ( self)

Return the name of the test case.

Reimplemented in TestCenterAdvanced.TestCaseGeneric.GenericTestCase.

Definition at line 989 of file TestCase.py.

References _testCaseName.

Referenced by openFiles(), and run().

◆ getPackage()

TestCenterAdvanced.TestCase.TestCase.getPackage ( self)

Return the identifier of the package the test case is in.

Definition at line 997 of file TestCase.py.

References TestCenterAdvanced.Master.Master.__xmlRoot, and __xmlRoot.

◆ getTestCaseNode()

TestCenterAdvanced.TestCase.TestCase.getTestCaseNode ( self)

◆ getType()

TestCenterAdvanced.TestCase.TestCase.getType ( self)

Return the type of this test case (generic or functional).

Reimplemented in TestCenterAdvanced.TestCaseFunctional.FunctionalTestCase, and TestCenterAdvanced.TestCaseGeneric.GenericTestCase.

Definition at line 981 of file TestCase.py.

Referenced by run().

◆ hasNetwork()

TestCenterAdvanced.TestCase.TestCase.hasNetwork ( self)

Return True if the test case has a network attached.

Definition at line 961 of file TestCase.py.

References networkFileName().

◆ isValid()

TestCenterAdvanced.TestCase.TestCase.isValid ( self)

Return True if the loaded test case is syntactically valid and should be executable.

Definition at line 957 of file TestCase.py.

References __valid.

◆ networkFileName()

TestCenterAdvanced.TestCase.TestCase.networkFileName ( self)

Returns the absolute file name of the attached network or an empty string if no network is attached.

Definition at line 965 of file TestCase.py.

References _ctx.

Referenced by hasNetwork().

◆ openFiles()

TestCenterAdvanced.TestCase.TestCase.openFiles ( self)

Open the files associated with the test case.

Definition at line 969 of file TestCase.py.

References _ctx, and getName().

◆ openNetwork()

TestCenterAdvanced.TestCase.TestCase.openNetwork ( self)

Open the internal network of the test case.

Definition at line 975 of file TestCase.py.

References _ctx.

◆ run()

◆ setTestCaseListener()

TestCenterAdvanced.TestCase.TestCase.setTestCaseListener ( self,
testCaseListener )

Member Data Documentation

◆ _ctx

◆ _dataDirectory

TestCenterAdvanced.TestCase.TestCase._dataDirectory = infoDict["dataDirectory"]
protected

Definition at line 241 of file TestCase.py.

Referenced by activate().

◆ _testCaseName

TestCenterAdvanced.TestCase.TestCase._testCaseName = testCaseName
protected

◆ _testHelper

TestCenterAdvanced.TestCase.TestCase._testHelper = TestHelper.getInstance()
protected

◆ callFieldValueTestCase

TestCenterAdvanced.TestCase.TestCase.callFieldValueTestCase

Definition at line 612 of file TestCase.py.

◆ futureDone

bool TestCenterAdvanced.TestCase.TestCase.futureDone = False

Definition at line 402 of file TestCase.py.


The documentation for this class was generated from the following file:
  • MeVisLab/Standard/Modules/Macros/Tests/TestCenterAdvanced/TestCase.py