summaryrefslogtreecommitdiff
path: root/src/beautifulsoup/tests/test_strainer.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/beautifulsoup/tests/test_strainer.py')
-rw-r--r--src/beautifulsoup/tests/test_strainer.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/beautifulsoup/tests/test_strainer.py b/src/beautifulsoup/tests/test_strainer.py
new file mode 100644
index 0000000..9a91463
--- /dev/null
+++ b/src/beautifulsoup/tests/test_strainer.py
@@ -0,0 +1,12 @@
+import unittest
+from helpers import SoupTest
+from beautifulsoup import BeautifulSoup
+from beautifulsoup.element import SoupStrainer
+
+class TestSoupStrainer(unittest.TestCase):
+
+ def test_soupstrainer(self):
+ strainer = SoupStrainer("b")
+ soup = BeautifulSoup("A <b>bold</b> <meta /> <i>statement</i>",
+ parseOnlyThese=strainer)
+ self.assertEquals(soup.decode(), "<b>bold</b>")