Example #1
0
 def test_generate_with_children(self):
     element = Element("div")
     element.extend(["<foo>", "&"])
     element.append_raw("&lt;bar&gt;")
     assert_equal(
         [b"<div>", b"&lt;foo&gt;", b"&amp;", b"&lt;bar&gt;", b"</div>"],
         list(iter(element)))
Example #2
0
 def test_append_extend(self):
     element = Element("div")
     element.append("Hello")
     element.extend([", ", "World", "!"])
     assert_equal(4, len(element))
     element.append_raw("Hello")
     element.extend_raw([", ", "World", "!"])
     assert_equal(8, len(element))
Example #3
0
 def test_append_extend(self):
     element = Element("div")
     element.append("Hello")
     element.extend([", ", "World", "!"])
     assert_equal(4, len(element))
     element.append_raw("Hello")
     element.extend_raw([", ", "World", "!"])
     assert_equal(8, len(element))