def test_nodes_to_html_nested(self):
     self.assertEqual(
         nodes_to_html([
             {'tag': 'a', 'children': [
                 {'tag': 'b', 'children': [
                     {'tag': 'c', 'children': [
                         {'tag': 'd', 'children': []}
                     ]}
                 ]}
             ]}
         ]),
         '<a><b><c><d></d></c></b></a>'
     )
Example #2
0
 def test_nodes_to_html(self):
     self.assertEqual(nodes_to_html(NODES_TEST_LIST), HTML_TEST_STR)
Example #3
0
 def test_nodes_to_html_blank(self):
     self.assertEqual(nodes_to_html([]), '')
 def test_clear_whitespace_1(self):
     x = '\n<p><i>A</i><b> </b><b>B <i>C</i><i><b></b></i> D </b> E </p><p> F </p>\n'
     y = '<p><i>A</i><b> </b><b>B <i>C</i><i><b></b></i> D </b>E </p><p>F </p>'
     self.assertEqual(nodes_to_html(html_to_nodes(x)), y)