コード例 #1
0
 def test_get_xml_parser(self):
     # Check to see if the correct lxml.etree.ETCompactXMLParser object is returned by the function `get_xml_parser`
     self.assertEqual(type(xml.get_xml_parser()), ET.ETCompatXMLParser)
コード例 #2
0
 def test_set_xml_parser(self):
     # Check to see if a new parser can be set by the function `set_xml_parser`
     parser = ET.ETCompatXMLParser()
     xml.set_xml_parser(parser)
     self.assertTrue(parser is xml.get_xml_parser())
コード例 #3
0
 def setUpClass(cls):
     cls.xml_parser = xml.get_xml_parser()