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