summaryrefslogtreecommitdiff
path: root/src/beautifulsoup/tests/test_strainer.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2010-12-29 10:49:57 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2010-12-29 10:49:57 -0500
commit1b20c5a032271dde35659d6089de6521969b1d02 (patch)
treece42ce5a2e0d305ed0a763824c1cbe580ca7e932 /src/beautifulsoup/tests/test_strainer.py
parent4d4241a9ef27cfb08082d8388831893ff9f8ee94 (diff)
Added test suites.
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>")