Example #1
0
  def test_defang_html_on_snippet_missing_b_close(self):
    html = """\
<div class="mouf"><p><span><img/>Hello <b>World!<script>...
    </script></p></div>"""
    safer_html = """\
 <p> <img/>Hello <b>World!</b> </p> """
    output = defang_html(html)
    self.assertEqual(safer_html,output)
Example #2
0
    def test_defang_html_on_snippet_missing_b_close(self):
        html = """\
<div class="mouf"><p><span><img/>Hello <b>World!<script>...
    </script></p></div>"""
        safer_html = """\
 <p> <img/>Hello <b>World!</b> </p> """
        output = defang_html(html)
        self.assertEqual(safer_html, output)
Example #3
0
  def test_defang_html_on_correct_html(self):
    html = """\
<div class="mouf"><p><span><img/>Hello</span><b>World!</b><script>...
    </script></p></div>"""
    safer_html = """\
 <p> <img/>Hello <b>World!</b></p> """
    output = defang_html(html)
    self.assertEqual(safer_html,output)
Example #4
0
    def test_defang_html_on_correct_html(self):
        html = """\
<div class="mouf"><p><span><img/>Hello</span><b>World!</b><script>...
    </script></p></div>"""
        safer_html = """\
 <p> <img/>Hello <b>World!</b></p> """
        output = defang_html(html)
        self.assertEqual(safer_html, output)