summaryrefslogtreecommitdiff
path: root/bs4/tests/test_htmlparser.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-20 14:05:38 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-20 14:05:38 -0500
commit60cb51632dce022d1a4aff18500d286e58e0bd5c (patch)
tree38120742636e4867b6284093ca4c19510623cf9a /bs4/tests/test_htmlparser.py
parent8f6446b1e45ad69ecd255cac3d9b9939127c91c2 (diff)
It's now possible to copy a BeautifulSoup object created with the html.parser treebuilder.
Diffstat (limited to 'bs4/tests/test_htmlparser.py')
-rw-r--r--bs4/tests/test_htmlparser.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bs4/tests/test_htmlparser.py b/bs4/tests/test_htmlparser.py
index a066fe0..d5b6ae1 100644
--- a/bs4/tests/test_htmlparser.py
+++ b/bs4/tests/test_htmlparser.py
@@ -1,3 +1,4 @@
+import copy
from HTMLParser import HTMLParseError
from bs4.element import Comment, Doctype, SoupStrainer
from bs4.builder import HTMLParserTreeBuilder
@@ -338,6 +339,11 @@ class TestHTMLParserTreeBuilder(SoupTest):
parse_only=strainer)
self.assertEqual(soup.decode(), "<b>bold</b>")
+ def test_deepcopy(self):
+ # Make sure you can copy the builder. This is important because
+ # the builder is part of a BeautifulSoup object, and we want to be
+ # able to copy that.
+ copy.deepcopy(self.default_builder)
class TestHTMLParserTreeBuilderInvalidMarkup(SoupTest):
"""Tests of invalid markup for the default tree builder.