TestCenter Reference
TestSupport.FieldValueTests.FieldValueTestCaseSet Class Reference

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

Inheritance diagram for TestSupport.FieldValueTests.FieldValueTestCaseSet:

Public Member Functions

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

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 248 of file FieldValueTests.py.

Constructor & Destructor Documentation

◆ __init__()

Member Function Documentation

◆ add()

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

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

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

◆ getList()

def 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 319 of file FieldValueTests.py.

References TestSupport.FieldValueTests.FieldValueTestCaseSet.__fieldValueTestCaseDict.

◆ load()

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

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

Remove the field-value test case with the given name.

If no such field-value test case exists False is returned.

Parameters
nameThe name of the field-value test case to be deleted.
Returns
True if removal succeeded.

Definition at line 373 of file FieldValueTests.py.

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

◆ rename()

def 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 396 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: