Esempio n. 1
0
    def test_parseFileAndReport(self):
        """
        L{tree.parseFileAndReport} parses the contents of the filename passed
        to it and returns the corresponding DOM.
        """
        path = FilePath(self.mktemp())
        path.setContent('<foo bar="baz">hello</foo>\n')

        document = tree.parseFileAndReport(path.path)
        self.assertXMLEqual(document.toxml(), '<?xml version="1.0" ?><foo bar="baz">hello</foo>')
Esempio n. 2
0
    def test_parseFileAndReport(self):
        """
        L{tree.parseFileAndReport} parses the contents of the filename passed
        to it and returns the corresponding DOM.
        """
        path = FilePath(self.mktemp())
        path.setContent('<foo bar="baz">hello</foo>\n')

        document = tree.parseFileAndReport(path.path)
        self.assertXMLEqual(
            document.toxml(),
            '<?xml version="1.0" ?><foo bar="baz">hello</foo>')
Esempio n. 3
0
 def _parseTest(self, xml):
     path = FilePath(self.mktemp())
     path.setContent(xml)
     return tree.parseFileAndReport(path.path)
Esempio n. 4
0
def doFile(file, checker):
    doc = tree.parseFileAndReport(file)
    if doc:
        checker.check(doc, file)
Esempio n. 5
0
def doFile(file, checker):
    dom = tree.parseFileAndReport(file)
    if dom:
        checker.check(dom, file)
Esempio n. 6
0
 def _parseTest(self, xml):
     path = FilePath(self.mktemp())
     path.setContent(xml)
     return tree.parseFileAndReport(path.path)