from xml.dom import pulldom
import unittest
SMALL_SAMPLE = """
Introduction to XSL
"""
class Test(unittest.TestCase):
def test_comment(self):
items = pulldom.parseString(SMALL_SAMPLE)
for evt, node in items:
if evt == pulldom.COMMENT:
break
else:
self.fail("No comment was encountered")
def test_end_document(self):
items = pulldom.parseString(SMALL_SAMPLE)
# Read all of the nodes up to and including