pysys.xml.descriptor module

class pysys.xml.descriptor.XMLDescriptorContainer(file, id, type, state, title, purpose, groups, modes, classname, module, input, output, reference, traceability)[source]

Bases: object

Holder class for the contents of a testcase descriptor.

__init__(file, id, type, state, title, purpose, groups, modes, classname, module, input, output, reference, traceability)[source]

Create an instance of the XMLDescriptorContainer class.

Parameters:
  • id – The testcase identifier
  • type – The type of the testcase (automated or manual)
  • state – The state of the testcase (runable, deprecated or skipped)
  • title – The title of the testcase
  • purpose – The purpose of the testcase
  • groups – A list of the user defined groups the testcase belongs to
  • modes – A list of the user defined modes the testcase can be run in
  • classname – The classname of the testcase
  • module – The full path to the python module containing the testcase class
  • input – The full path to the input directory of the testcase
  • output – The full path to the output parent directory of the testcase
  • reference – The full path to the reference directory of the testcase
  • traceability – A list of the requirements covered by the testcase
class pysys.xml.descriptor.XMLDescriptorCreator(file, type='auto', group='', testclass='PySysTest', module='run')[source]

Bases: object

Helper class to create a test descriptor template.

__init__(file, type='auto', group='', testclass='PySysTest', module='run')[source]

Class constructor.

writeXML()[source]

Write a test descriptor template to file.

class pysys.xml.descriptor.XMLDescriptorParser(xmlfile)[source]

Bases: object

Helper class to parse an XML test descriptor.

The class uses the minidom DOM (Document Object Model) non validating parser to provide accessor methods to return element attributes and character data from the test descriptor file. The class is instantiated with the filename of the test descriptor. It is the responsibility of the user of the class to call the unlink() method of the class on completion in order to free the memory used in the parsing.

__init__(xmlfile)[source]

Class constructor.

getClassDetails()[source]

Return the test class attributes (name, module, searchpath), contained in the class element.

getContainer()[source]

Create and return an instance of XMLDescriptorContainer for the contents of the descriptor.

getFile()[source]

Return the filename of the test descriptor.

getGroups()[source]

Return a list of the group names, contained in the character data of the group elements.

getID()[source]

Return the id of the test.

getModes()[source]

Return a list of the mode names, contained in the character data of the mode elements.

getPurpose()[source]

Return the test purpose character data of the description element.

getRequirements()[source]

Return a list of the requirement ids, contained in the character data of the requirement elements.

getState()[source]

Return the state attribute of the test element.

getTestInput()[source]

Return the test input path, contained in the input element.

getTestOutput()[source]

Return the test output path, contained in the output element.

getTestReference()[source]

Return the test reference path, contained in the reference element.

getTitle()[source]

Return the test titlecharacter data of the description element.

getType()[source]

Return the type attribute of the test element.

Clean up the DOM on completion.