Package pysys :: Package writer :: Class XMLResultsWriter
[frames] | no frames]

Class XMLResultsWriter

source code

Class to log results to logfile in XML format.

The class creates a DOM document to represent the test output results and writes the DOM to the logfile using toprettyxml(). The outputDir, stylesheet, useFileURL attributes of the class can be over-ridden in the PySys project file using the nested <property> tag on the <writer> tag.

Instance Methods
 
__init__(self, logfile)
Create an instance of the TextResultsWriter class.
source code
 
setup(self, **kwargs)
Implementation of the setup method.
source code
 
cleanup(self, **kwargs)
Implementation of the cleanup method.
source code
 
processResult(self, testObj, **kwargs)
Implementation of the processResult method.
source code
Instance Variables
string outputDir = None
Path to output directory to write the test summary files
string stylesheet = '/System/Library/Frameworks/Python.framework/Vers...
Path to the XSL stylesheet
string (true | false) useFileURL = 'false'
Indicates if full file URLs are to be used for local resource references
Method Details

__init__(self, logfile)
(Constructor)

source code 

Create an instance of the TextResultsWriter class.

Parameters:
  • logfile - The filename template for the logging of test results

setup(self, **kwargs)

source code 

Implementation of the setup method.

Creates the DOM for the test output summary and writes to logfile.

Parameters:
  • kwargs - Variable argument list

cleanup(self, **kwargs)

source code 

Implementation of the cleanup method.

Updates the test run status in the DOM, and re-writes to logfile.

Parameters:
  • kwargs - Variable argument list

processResult(self, testObj, **kwargs)

source code 

Implementation of the processResult method.

Adds the results node to the DOM and re-writes to logfile.

Parameters:

Instance Variable Details

stylesheet

Path to the XSL stylesheet
Type:
string
Value:
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.\
7/site-packages/pysys-log.xsl'