summaryrefslogtreecommitdiff
path: root/src/beautifulsoup/tests/test_html5lib.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/beautifulsoup/tests/test_html5lib.py')
-rw-r--r--src/beautifulsoup/tests/test_html5lib.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/beautifulsoup/tests/test_html5lib.py b/src/beautifulsoup/tests/test_html5lib.py
new file mode 100644
index 0000000..f92771b
--- /dev/null
+++ b/src/beautifulsoup/tests/test_html5lib.py
@@ -0,0 +1,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>")
+