class_docstr: Test the hard-to-reach parts of pulldom.
docstr: Test some of the hard-to-reach parts of the parser, using a mock
  parser.
docstr_tok: ["Test","some","of","the","hard-to-reach","parts","of","the","parser",",","using","a","mock","parser","."]
code: def _test_thorough(self, pd, before_root=True):
      """Test some of the hard-to-reach parts of the parser, using a mock
      parser."""
  
      evt, node = next(pd)
      self.assertEqual(pulldom.START_DOCUMENT, evt)
      # Just check the node is a Document:
      self.assertTrue(hasattr(node, "createElement"))
  
      if before_root:
          evt, node = next(pd)
          self.assertEqual(pulldom.COMMENT, evt)
          self.assertEqual("a comment", node.data)
          evt, node = next(pd)
          self.assertEqual(pulldom.PROCESSING_INSTRUCTION, evt)
          self.assertEqual("target", node.target)
          self.assertEqual("data", node.data)
  
      evt, node = next(pd)
      self.assertEqual(pulldom.START_ELEMENT, evt)
      self.assertEqual("html", node.tagName)
  
      evt, node = next(pd)
      self.assertEqual(pulldom.COMMENT, evt)
      self.assertEqual("a comment", node.data)
      evt, node = next(pd)
      self.assertEqual(pulldom.PROCESSING_INSTRUCTION, evt)
      self.assertEqual("target", node.target)
      self.assertEqual("data", node.data)
  
      evt, node = next(pd)
      self.assertEqual(pulldom.START_ELEMENT, evt)
      self.assertEqual("p", node.tagName)
  
      evt, node = next(pd)
      self.assertEqual(pulldom.CHARACTERS, evt)
      self.assertEqual("text", node.data)
      evt, node = next(pd)
      self.assertEqual(pulldom.END_ELEMENT, evt)
      self.assertEqual("p", node.tagName)
      evt, node = next(pd)
      self.assertEqual(pulldom.END_ELEMENT, evt)
      self.assertEqual("html", node.tagName)
      evt, node = next(pd)
      self.assertEqual(pulldom.END_DOCUMENT, evt)
  
imports: import io
  import unittest
  import xml.sax
  from xml.sax.xmlreader import AttributesImpl
  from xml.sax.handler import feature_external_ges
  from xml.dom import pulldom
  from test.support import findfile
label_desc: Use image node_id 4 for calling the ThoroughTestCase obj's underlying member method code with example usage: obj._test_thorough(pd, before_root) without return types