コード例 #1
0
 def test_unescape_additional_entities(self):
     expected = '<hello>T\'was a dark & "stormy" night</hello>'
     input = '&lt;hello&gt;T&apos;was&nbsp;a&nbsp;dark&nbsp;&amp;&nbsp;&quot;stormy&quot;&nbsp;night&lt;/hello&gt;'
     self.assertEquals(expected, codec_xml.unescape(input, {'&nbsp;': ' '}))
コード例 #2
0
 def test_unescape_override_entities(self):
     expected = '<hello>T\'was a dark & "stormy" night</hello>'
     input = '&lt;hello&gt;T&blah;was a dark &amp; &quot;stormy&quot; night&lt;/hello&gt;'
     self.assertEquals(expected, codec_xml.unescape(input, {"&blah;": "'"}))
コード例 #3
0
 def test_unescape(self):
     expected = '<hello>T\'was a dark & "stormy" night</hello>'
     input = '&lt;hello&gt;T&apos;was a dark &amp; &quot;stormy&quot; night&lt;/hello&gt;'
     self.assertEquals(expected, codec_xml.unescape(input))