TestCenter Reference
TestSupport.FieldValueTests.FieldValueTestCaseSet Class Reference

A class collecting a set of field-value test cases. More...

Public Member Functions

 __init__ (self, context)
 The default constructor.
 
 load (self, filename)
 Try to load the field-value test case set from the given XML file.
 
 save (self, filename)
 Save the XML data structure.
 
 getList (self)
 Return the list of names of the existing field-value test cases.
 
 add (self, fieldValueTestCase)
 Add the given field-value test case to the FieldValueTestCaseSet.
 
 copy (self, source, destination)
 Create a copy of the given field-value test case with the given new name.
 
 remove (self, name)
 Remove the field-value test case with the given name.
 
 rename (self, name, newName)
 Rename a given field-value test case.
 
 get (self, name)
 Return the field-value test case with the given name.
 

Detailed Description

A class collecting a set of field-value test cases.

The contained field-value test cases are stored in an XML data structure. There is a mapping between the XML data structure and actual objects of type FieldValueTestCase. This mapping must be updated. The objects are created on demand to minimize initial loading. Each test case contains field-value lists that describe the following:

  • parameterization: The given fields are set to the given values. Triggers are touched.
  • expected results: A list of fields and the values they should have.
  • results to save: A list of fields whose values should be saved. A field-value list is a list of tuples consisting of information on the module, the field, the field's type and value. A field list just lacks the information on the value.

Definition at line 245 of file FieldValueTests.py.

Constructor & Destructor Documentation

◆ __init__()

Member Function Documentation

◆ add()

TestSupport.FieldValueTests.FieldValueTestCaseSet.add ( self,
fieldValueTestCase )

Add the given field-value test case to the FieldValueTestCaseSet.

If a field-value test case with the same name is already known False is returned.

Parameters
fieldValueTestCaseThe new field-value test case.
Returns
True if field-value test case could be added.

Definition at line 326 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCaseSet.__fieldValueTestCaseDict, TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, and TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot.

Referenced by TestSupport.FieldValueTests.FieldValueTestCaseSet.copy().

◆ copy()

TestSupport.FieldValueTests.FieldValueTestCaseSet.copy ( self,
source,
destination )

Create a copy of the given field-value test case with the given new name.

If either the source does not exist or a field-value test case with the destination name already exists False is returned.

Parameters
sourceThe name of the existing field-value test case.
destinationThe name of the created new field-value test case.
Returns
True if copy operation succeeded.

Definition at line 345 of file FieldValueTests.py.

References TestCenterAdvanced.Slave.Slave.__ctx, TestSupport.ChangeSet.ChangeSet.__ctx, TestSupport.FieldValueTests.FieldValueTestCaseSet.__ctx, TestSupport.FieldValueTests.FieldValueTestCase.__ctx, TestSupport.FieldValueTests.FieldValueTestCaseSet.__fieldValueTestCaseDict, TestSupport.FieldValueTests.FieldValueTestCaseSet.__getFieldValueTestCaseNode(), TestSupport.FieldValueTests.FieldValueTestCase.FieldListBase.add(), TestSupport.FieldValueTests.FieldValueTestCaseSet.add(), and TestSupport.FieldValueTests.FieldValueTestCaseSet.save().

◆ get()

TestSupport.FieldValueTests.FieldValueTestCaseSet.get ( self,
name )

◆ getList()

TestSupport.FieldValueTests.FieldValueTestCaseSet.getList ( self)

Return the list of names of the existing field-value test cases.

Returns
The list of existing field-value test cases.

Definition at line 316 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCaseSet.__fieldValueTestCaseDict.

◆ load()

TestSupport.FieldValueTests.FieldValueTestCaseSet.load ( self,
filename )

Try to load the field-value test case set from the given XML file.

The field-value test case set must not contain any field-value test cases; Otherwise an exception will be thrown.

Parameters
filenameThe file to load.
Returns
True if loading succeeded. False otherwise.

Definition at line 277 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCaseSet.__fieldValueTestCaseDict, TestSupport.FieldValueTests.FieldValueTestCaseSet.__verify(), TestCenterAdvanced.Master.Master.__xmlRoot, TestCenterAdvanced.TestCase.TestCase.__xmlRoot, TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlRoot, and TestSupport.FieldValueTests.FieldValueTestCaseSet.__xmlTree.

◆ remove()

TestSupport.FieldValueTests.FieldValueTestCaseSet.remove ( self,
name )

◆ rename()

TestSupport.FieldValueTests.FieldValueTestCaseSet.rename ( self,
name,
newName )

Rename a given field-value test case.

The given field-value test case is saved under a new name. If either no field-value test case with the given name or one with the new name exist False is returned.

Parameters
nameThe name of the existing field-value test case.
newNameThe new name of the given field-value test case.
Returns
True if rename succeeded.

Definition at line 393 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCaseSet.__fieldValueTestCaseDict, and TestSupport.FieldValueTests.FieldValueTestCaseSet.__getFieldValueTestCaseNode().

◆ save()


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