From dd223ac4913e461951b4325bb3826259d62d29a8 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Thu, 15 Aug 2013 08:31:34 -0400 Subject: Make sure the optimized find_all() ResultSets actually contain the right data. --- bs4/tests/test_tree.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bs4/tests') diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py index 1c2c93b..f8515c0 100644 --- a/bs4/tests/test_tree.py +++ b/bs4/tests/test_tree.py @@ -70,6 +70,16 @@ class TestFind(TreeTest): soup = self.soup(u'

Räksmörgås

') self.assertEqual(soup.find(text=u'Räksmörgås'), u'Räksmörgås') + def test_find_everything(self): + """Test an optimization that finds all tags.""" + soup = self.soup("foobar") + self.assertEqual(2, len(soup.find_all())) + + def test_find_everything_with_name(self): + """Test an optimization that finds all tags with a given name.""" + soup = self.soup("foobarbaz") + self.assertEqual(2, len(soup.find_all('a'))) + class TestFindAll(TreeTest): """Basic tests of the find_all() method.""" -- cgit v1.2.3