Exemple #1
0
    def test_defaults(self):
        self.assertEqual(pyexpat.get_reset_dtd(), False)
        self.assertEqual(pyexpat.get_max_entity_expansions(),
                         pyexpat.XML_DEFAULT_MAX_ENTITY_EXPANSIONS)
        self.assertEqual(pyexpat.get_max_entity_indirections(),
                         pyexpat.XML_DEFAULT_MAX_ENTITY_INDIRECTIONS)

        pyexpat.set_reset_dtd(True)
        pyexpat.set_max_entity_expansions(10)
        pyexpat.set_max_entity_indirections(10)

        self.assertEqual(pyexpat.get_reset_dtd(), True)
        self.assertEqual(pyexpat.get_max_entity_expansions(), 10)
        self.assertEqual(pyexpat.get_max_entity_indirections(), 10)

        p = pyexpat.ParserCreate()
        self.assertEqual(p.max_entity_indirections, 10)
        self.assertEqual(p.max_entity_expansions, 10)
        self.assertEqual(p.reset_dtd, True)
Exemple #2
0
    def test_defaults(self):
        self.assertEqual(pyexpat.get_reset_dtd(), False)
        self.assertEqual(pyexpat.get_max_entity_expansions(),
                         pyexpat.XML_DEFAULT_MAX_ENTITY_EXPANSIONS)
        self.assertEqual(pyexpat.get_max_entity_indirections(),
                         pyexpat.XML_DEFAULT_MAX_ENTITY_INDIRECTIONS)

        pyexpat.set_reset_dtd(True)
        pyexpat.set_max_entity_expansions(10)
        pyexpat.set_max_entity_indirections(10)

        self.assertEqual(pyexpat.get_reset_dtd(), True)
        self.assertEqual(pyexpat.get_max_entity_expansions(), 10)
        self.assertEqual(pyexpat.get_max_entity_indirections(), 10)

        p = pyexpat.ParserCreate()
        self.assertEqual(p.max_entity_indirections, 10)
        self.assertEqual(p.max_entity_expansions, 10)
        self.assertEqual(p.reset_dtd, True)
Exemple #3
0
 def setUp(self):
     pyexpat.set_reset_dtd(False)
     pyexpat.set_max_entity_expansions(
         pyexpat.XML_DEFAULT_MAX_ENTITY_EXPANSIONS)
     pyexpat.set_max_entity_indirections(
         pyexpat.XML_DEFAULT_MAX_ENTITY_INDIRECTIONS)
Exemple #4
0
 def setUp(self):
     pyexpat.set_reset_dtd(False)
     pyexpat.set_max_entity_expansions(
         pyexpat.XML_DEFAULT_MAX_ENTITY_EXPANSIONS)
     pyexpat.set_max_entity_indirections(
         pyexpat.XML_DEFAULT_MAX_ENTITY_INDIRECTIONS)