Beispiel #1
0
 def test_convert_converts_amp_lt_entity(self):
     text = "<"
     expected = "<"
     obj = xml_utils.Entity2Char()
     self.assertEqual(expected, obj.convert(text))
Beispiel #2
0
 def test_convert_does_not_convert_gt_entity(self):
     text = ">"
     expected = ">"
     obj = xml_utils.Entity2Char()
     self.assertEqual(expected, obj.convert(text))
Beispiel #3
0
 def test_convert_converts_amp_plus_incomplete_entity(self):
     text = "&ccedil&#x987"
     expected = "çই"
     obj = xml_utils.Entity2Char()
     self.assertEqual(expected, obj.convert(text))
Beispiel #4
0
 def test_convert_converts_ge_entity(self):
     text = "≥"
     expected = "≥"
     obj = xml_utils.Entity2Char()
     self.assertEqual(expected, obj.convert(text))
Beispiel #5
0
 def test_convert_converts_incomplete_ccedil_entity(self):
     text = "&ccedil"
     expected = "ç"
     obj = xml_utils.Entity2Char()
     self.assertEqual(expected, obj.convert(text))
Beispiel #6
0
 def test_convert_converts_incomplete_entity(self):
     text = "&#30952&#x987"
     expected = "磨ই"
     obj = xml_utils.Entity2Char()
     self.assertEqual(expected, obj.convert(text))
Beispiel #7
0
 def test_convert_converts_hexadecimal_entity(self):
     text = "ই"
     expected = "ই"
     obj = xml_utils.Entity2Char()
     self.assertEqual(expected, obj.convert(text))
Beispiel #8
0
 def test_convert_converts_named_entity(self):
     text = "çÿ"
     expected = "çÿ"
     obj = xml_utils.Entity2Char()
     self.assertEqual(expected, obj.convert(text))
Beispiel #9
0
 def test_convert_converts_decimal_entity(self):
     text = "磨"
     expected = "磨"
     obj = xml_utils.Entity2Char()
     self.assertEqual(expected, obj.convert(text))