예제 #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>")    
예제 #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>")    
예제 #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>")    
예제 #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>")
예제 #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>")
예제 #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>"
     )
예제 #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>")
예제 #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>")