def test_paragraph_with_one_blank(self):
     html = "<html><p>One paragraph with content</p><p> </p></html>"
     self.assertEqual(pcleaner.clean(html), "<html><p>One paragraph with content</p></html>")    
 def test_blank_paragraphs_with_attributes(self):
     html = "<html><p>One paragraph with content</p><p>        </p><p style='margin: 5'> </p><p></p><p>other par</p></html>"
     self.assertEqual(pcleaner.clean(html), "<html><p>One paragraph with content</p><p>other par</p></html>")    
 def test_paragraphs_with_newline_remains(self):
     html = "<html><p>One paragraph with content</p><p>\n        </p><p style='margin: 5'> </p><p></p><p>other par</p></html>"
     self.assertEqual(pcleaner.clean(html), "<html><p>One paragraph with content</p><p>\n        </p><p>other par</p></html>")    
 def test_more_blank_paragraphs(self):
     html = "<html><p>One paragraph with content</p><p>        </p><p> </p><p></p><p>other par</p></html>"  
     self.assertEqual(pcleaner.clean(html), "<html><p>One paragraph with content</p><p>other par</p></html>")
Example #5
0
 def test_paragraph_without_content(self):
     html = "<html><p>One paragraph with content</p><p></p></html>"
     self.assertEqual(pcleaner.clean(html),
                      "<html><p>One paragraph with content</p></html>")
Example #6
0
 def test_paragraphs_with_newline_remains(self):
     html = "<html><p>One paragraph with content</p><p>\n        </p><p style='margin: 5'> </p><p></p><p>other par</p></html>"
     self.assertEqual(
         pcleaner.clean(html),
         "<html><p>One paragraph with content</p><p>\n        </p><p>other par</p></html>"
     )
Example #7
0
 def test_blank_paragraphs_with_attributes(self):
     html = "<html><p>One paragraph with content</p><p>        </p><p style='margin: 5'> </p><p></p><p>other par</p></html>"
     self.assertEqual(
         pcleaner.clean(html),
         "<html><p>One paragraph with content</p><p>other par</p></html>")
Example #8
0
 def test_more_blank_paragraphs(self):
     html = "<html><p>One paragraph with content</p><p>        </p><p> </p><p></p><p>other par</p></html>"
     self.assertEqual(
         pcleaner.clean(html),
         "<html><p>One paragraph with content</p><p>other par</p></html>")