Ejemplo n.º 1
0
 def test_triple_hyphen(self):
     comment = Comment(f"<!--A comment with ---> Text <end/>")
     with self.assertRaises(XMLError):
         comment.parse_to_end({})
Ejemplo n.º 2
0
 def test_stops_parsing(self):
     comment = Comment("<!-- A comment which should end here--> And more text")
     unparsed_xml = comment.parse_to_end({})
     self.assertEqual(" And more text", unparsed_xml)
Ejemplo n.º 3
0
 def test_forbidden_characters(self):
     for char in ["\u0001", "\u0003", "\u0010", "\ufffe", "\uffff"]:
         with self.subTest(f"Char: {char}"):
             comment = Comment(f"<!--A comment with {char} --> Text <end/>")
             with self.assertRaises(XMLError):
                 comment.parse_to_end({})