diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-20 19:50:45 -0500 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2011-02-20 19:50:45 -0500 |
commit | 2fa73e2cb99b0816148ade6150f378993907534e (patch) | |
tree | cf7e2371881c680990157cae621f6045f5941f56 /tests/test_tree.py | |
parent | e6320fad4cd162ab6c7dfe02be5206f5c3f8c25b (diff) | |
parent | ce3742abd4c7fe39247569e82e2b3acdd6052bb1 (diff) |
Added a registry for tree builders and made it possible to find a tree builder that has the features you want from the BeautifulSoup constructor.
Diffstat (limited to 'tests/test_tree.py')
-rw-r--r-- | tests/test_tree.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_tree.py b/tests/test_tree.py index 384d518..0b3d72e 100644 --- a/tests/test_tree.py +++ b/tests/test_tree.py @@ -13,6 +13,7 @@ import copy import cPickle as pickle import re from beautifulsoup import BeautifulSoup +from beautifulsoup.builder import builder_registry from beautifulsoup.element import CData, SoupStrainer, Tag from beautifulsoup.testing import SoupTest @@ -523,7 +524,7 @@ class TestTreeModification(SoupTest): self.assertEqual(soup.decode(), self.document_for('<a id2="foo"></a>')) def test_new_tag_creation(self): - builder = BeautifulSoup.default_builder() + builder = builder_registry.lookup('html5lib')() soup = self.soup("<body></body>", builder=builder) a = Tag(soup, builder, 'a') ol = Tag(soup, builder, 'ol') @@ -863,7 +864,7 @@ class TestSubstitutions(SoupTest): # meta tag got filtered out by the strainer. This test makes # sure that doesn't happen. strainer = SoupStrainer('pre') - soup = self.soup(markup, parseOnlyThese=strainer) + soup = self.soup(markup, parse_only=strainer) self.assertEquals(soup.contents[0].name, 'pre') |