blob: f92771b7c0b35c55e412000457c649ec1067376d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
from helpers import SoupTest
from beautifulsoup.builder.html5lib_builder import HTML5TreeBuilder
class TestHTML5Builder(SoupTest):
def setUp(self):
self.default_builder = HTML5TreeBuilder()
def test_bare_string(self):
self.assertSoupEquals("A bare string")
def test_tag_nesting(self):
b_tag = "<b>Inside a B tag</b>"
self.assertSoupEquals(b_tag)
nested_b_tag = "<p>A <i>nested <b>tag</b></i></p>"
self.assertSoupEquals(nested_b_tag)
def test_self_closing(self):
self.assertSoupEquals(
"<p>A <meta> tag</p>", "<p>A <meta /> tag</p>")
|