Ejemplo n.º 1
0
def test_sax_location_str():
    # pass various values from a locator to the SAXParseException to
    # make sure that the __str__() doesn't fall apart when None is
    # passed instead of an integer line and column number
    #
    # use "normal" values for the locator:
    str(Location(DummyLocator(1, 1)))
    # use None for the line number:
    str(Location(DummyLocator(None, 1)))
    # use None for the column number:
    str(Location(DummyLocator(1, None)))
    # use None for both:
    str(Location(DummyLocator(None, None)))
    return 1
Ejemplo n.º 2
0
 def setDocumentLocator(self, locator):
     XMLGenerator.setDocumentLocator(self, locator)
     self.location = Location(self._locator)
Ejemplo n.º 3
0
 def endDocument(self):
     XMLGenerator.endDocument(self)
     self.location = Location(self._locator)