# -*- coding: utf-8 -*-
# $Id: testXML.py 1603 2011-10-10 12:33:02Z amelung $
#
# Copyright (c) 2007-2011 Otto-von-Guericke-Universität Magdeburg
#
# This file is part of ECSpooler.
import unittest
"""
"""
'tests': ['default'],
}
"""_wellFormedCheck should return nothing when not having requested it to run. Additionally, no feedback should be generated."""
<!DOCTYPE hallo SYSTEM "asdkfj.dtd">
<hallo>Hallo Welt!</hallo>'''
if result:
else:
"""_wellFormedCheck should return a false Backendresult for a non-well-formed XML file."""
<!DOCTYPE hallo SYSTEM "asdkfj.dtd">
<hallo>Hallo Welt!</hallo'''
if result:
else:
"""_wellFormedCheck should return nothing for a well-formed XML file."""
<!DOCTYPE hallo SYSTEM "asdkfj.dtd">
<hallo>Hallo Welt!</hallo>'''
if result:
else:
self.assertTrue(feedbackLength < len(backend.feedback), 'No feedback was generated when running on a well-formed XML file.')
"""_validationCheck should return false for a non-valid XML file."""
<!DOCTYPE hallo SYSTEM "asdkfj.dtd">
<hola>Hallo Welt!</hola>'''
if result:
else:
"""_validationCheck should return nothing for a valid XML file."""
<!DOCTYPE hallo SYSTEM "asdkfj.dtd">
<hallo>Hallo Welt!</hallo>'''
if result:
else:
self.assertTrue(feedbackLength < len(backend.feedback), 'No feedback was generated when running on a valid XML file.')
"""_validationCheck should return nothing when running without DTD. Additionally, no feedback should be generated"""
<!DOCTYPE hallo SYSTEM "asdkfj.dtd">
<hola>Hallo Welt!</hola>'''
if result:
else:
"""_xPathCheck should return false if the requested node sets or values differ."""
<hallo>Hallo Welt!</hallo>'''
${DOC}/hallo'''
<hallo>Guten Tag Welt!</hallo>'''
if result:
else:
"""_xPathCheck should return nothing if the requested node sets or values do not differ."""
<hallo>Hallo Welt!</hallo>'''
${DOC}/hallo'''
<hallo>Hallo Welt!</hallo>'''
if result:
self.fail('_xPathCheck should not return anything when running on a XML file semantically equivalent to the model solution.')
else:
"""_xPathCheck should return nothing when running without a model solution. Additionally, no feedback should be generated"""
${DOC}/hallo'''
<hallo>Hallo Welt!</hallo>'''
if result:
else:
"""_xPathCheck should return nothing when running without a model solution. Additionally, no feedback should be generated"""
<hallo>Hallo Welt!</hallo>'''
<hallo>Hallo Welt!</hallo>'''
if result:
else:
"""When InputField 'verbose' is checked, a detailed feedback should be generated."""
<hallo>Hallo Welt!</hallo>'''
<hallo>Guten Tag Welt!</hallo>'''
# We do expect that with the given XPath expression both following tags are in the resulting feedback:
expectedFromModel = '<hallo>Hallo Welt!</hallo>'
expectedFromSubmission = '<hallo>Guten Tag Welt!</hallo>'
if result:
self.assertTrue(message.find(expectedFromModel) != -1, '"%s" or "%s" were not found in message "%s"' % (expectedFromModel, expectedFromSubmission, message))
else:
def test_suite():
"""
"""
return suite
# -- main ---------------------------------------------------------------------
if __name__ == '__main__':