summaryrefslogtreecommitdiff
path: root/src/beautifulsoup/tests/treebuilder.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2010-12-26 15:27:37 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2010-12-26 15:27:37 -0500
commit9bf34da305075da4f934d381028a9e4b8c2e7717 (patch)
treeeeb275f40cd60ab8afb3006b59093c87fdc872e7 /src/beautifulsoup/tests/treebuilder.py
parent66237256dfec2976aa62cff78ae1dbeafab0c4cf (diff)
Got lxml test suite to work.
Diffstat (limited to 'src/beautifulsoup/tests/treebuilder.py')
-rw-r--r--src/beautifulsoup/tests/treebuilder.py46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/beautifulsoup/tests/treebuilder.py b/src/beautifulsoup/tests/treebuilder.py
deleted file mode 100644
index 489708d..0000000
--- a/src/beautifulsoup/tests/treebuilder.py
+++ /dev/null
@@ -1,46 +0,0 @@
-"""Tree builder compatibility suite.
-
-If you create a tree builder class, also create a test suite that
-subclasses this one. This test suite will parse various bits of
-well-formed HTML with your tree builder. Not every tree builder will
-handle bad HTML in the same way, but every builder should be able to
-handle _good_ HTML in the same way.
-"""
-
-import unittest
-from beautifulsoup import BeautifulSoup
-from beautifulsoup.element import SoupStrainer
-from test_soup import SoupTest
-
-class CompatibilityTest(SoupTest):
-
- def __init__(self, builder):
- self.builder = builder
-
- _testMethodName = "test"
-
- def test(self):
- self.test_bare_string()
- self.test_tag_nesting()
- self.test_self_closing()
- self.test_soupstrainer()
-
- def test_bare_string(self):
- self.assertSoupEquals("A bare string")
-
- def test_tag_nesting(self):
- self.assertSoupEquals("<b>Inside a B tag</b>")
- self.assertSoupEquals("<p>A <i>nested <b>tag</b></i></p>")
-
- def test_self_closing(self):
- self.assertSoupEquals("A <meta> tag", "A <meta /> tag")
-
- def test_soupstrainer(self):
- strainer = SoupStrainer("b")
- soup = BeautifulSoup("A <b>bold</b> <i>statement</i>",
- parseOnlyThese=strainer)
- self.assertEquals(soup.decode(), "<b>bold</b>")
-
- soup = BeautifulSoup("A <b>bold</b> <meta> <i>statement</i>",
- parseOnlyThese=strainer)
- self.assertEquals(soup.decode(), "<b>bold</b>")