MCPcopy Create free account
hub / github.com/RustPython/RustPython / test_sax_parse_exception_str

Method test_sax_parse_exception_str

Lib/test/test_sax.py:1375–1391  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1373 self.assertEqual(parser.getLineNumber(), 1)
1374
1375 def test_sax_parse_exception_str(self):
1376 # pass various values from a locator to the SAXParseException to
1377 # make sure that the __str__() doesn't fall apart when None is
1378 # passed instead of an integer line and column number
1379 #
1380 # use "normal" values for the locator:
1381 str(SAXParseException("message", None,
1382 self.DummyLocator(1, 1)))
1383 # use None for the line number:
1384 str(SAXParseException("message", None,
1385 self.DummyLocator(None, 1)))
1386 # use None for the column number:
1387 str(SAXParseException("message", None,
1388 self.DummyLocator(1, None)))
1389 # use None for both:
1390 str(SAXParseException("message", None,
1391 self.DummyLocator(None, None)))
1392
1393 class DummyLocator:
1394 def __init__(self, lineno, colno):

Callers

nothing calls this directly

Calls 2

SAXParseExceptionClass · 0.90
strFunction · 0.85

Tested by

no test coverage detected