diff options
author | Leonard Richardson <leonardr@segfault.org> | 2023-01-25 15:04:42 -0500 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2023-01-25 15:04:42 -0500 |
commit | 9b4eb2db8a830ff4522de4b744548039fdf5a2e6 (patch) | |
tree | 702868259331cb80ea710c56626105b92ee840d1 /beautifulsoup/testing.py | |
parent | 02e7c7271829655781feb4dd5476814511096111 (diff) |
Removed very copy of the code that was imported as part of the bzr import but not removed.
Diffstat (limited to 'beautifulsoup/testing.py')
-rw-r--r-- | beautifulsoup/testing.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/beautifulsoup/testing.py b/beautifulsoup/testing.py deleted file mode 100644 index 8fd9abf..0000000 --- a/beautifulsoup/testing.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Helper classes for tests.""" - -import unittest -from beautifulsoup import BeautifulSoup -from beautifulsoup.element import Comment, SoupStrainer -from beautifulsoup.builder import LXMLTreeBuilder - -class SoupTest(unittest.TestCase): - - @property - def default_builder(self): - return LXMLTreeBuilder() - - def soup(self, markup, **kwargs): - """Build a Beautiful Soup object from markup.""" - builder = kwargs.pop('builder', self.default_builder) - return BeautifulSoup(markup, builder=builder, **kwargs) - - def document_for(self, markup): - """Turn an HTML fragment into a document. - - The details depend on the builder. - """ - return self.default_builder.test_fragment_to_document(markup) - - def assertSoupEquals(self, to_parse, compare_parsed_to=None): - builder = self.default_builder - obj = BeautifulSoup(to_parse, builder=builder) - if compare_parsed_to is None: - compare_parsed_to = to_parse - - self.assertEquals(obj.decode(), self.document_for(compare_parsed_to)) - - - - - |