def handle_comment(self, data): cmt = POM.Comment(data) try: self.stack[-1].append(cmt) except IndexError: # comment is outside of root node self.comments.append(cmt)
def test_1CommentEncoding(self): cmt = POM.Comment("some ------- comment-") self.assert_(str(cmt) == '<!-- some - - - - comment- -->')