def test_patternExists_9(self): treeReader = io.StringIO("<c><d><e></e><f></f></d><g></g></c>") tree = ET.fromstring(treeReader.read()) patternReader = io.StringIO("<c><d><e></e><f></f></d><g></g></c>") pattern = ET.fromstring(patternReader.read()) self.assertTrue(xml_patternExists(tree, pattern))
def test_patternExists_1(self): treeReader = io.StringIO("<three><four></four><five></five></three>") tree = ET.fromstring(treeReader.read()) patternReader = io.StringIO("<three><four></four><five></five></three>") pattern = ET.fromstring(patternReader.read()) self.assertTrue(xml_patternExists(tree, pattern))
def test_patternExists_6(self): treeReader = io.StringIO("<THU><Team><Cooly></Cooly></Team></THU>") tree = ET.fromstring(treeReader.read()) patternReader = io.StringIO("<Team><Cooly></Cooly></Team>") pattern = ET.fromstring(patternReader.read()) self.assertTrue(not xml_patternExists(tree, pattern))