Ejemplo n.º 1
0
 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>")    
Ejemplo n.º 2
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>")    
Ejemplo n.º 3
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>")    
Ejemplo n.º 4
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>")
Ejemplo n.º 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>")
Ejemplo n.º 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>"
     )
Ejemplo n.º 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>")
Ejemplo n.º 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>")