Package gavo :: Package helpers :: Module testtricks :: Class XSDTestMixin
[frames] | no frames]

Class XSDTestMixin

source code

object --+
         |
        XSDTestMixin

provides a assertValidates method doing XSD validation.

assertValidates raises an assertion error with the validator's messages on an error. You can optionally pass a leaveOffending argument to make the method store the offending document in badDocument.xml.

The whole thing needs Xerces-J in the form of xsdval.class in the current directory.

The validator itself is a java class xsdval.class built by ../schemata/makeValidator.py. If you have java installed, calling that in the schemata directory should just work (TM). With that validator and the schemata in place, no network connection should be necessary to run validation tests.

Instance Methods
 
assertValidates(self, xmlSource, leaveOffending=False) source code
 
assertWellformed(self, xmlSource) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__