From b689fd9c53a9b43ea37e473df6d2f56e0e7e1bcf Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Wed, 29 Dec 2010 20:59:40 -0500 Subject: A few more simple tests. --- src/beautifulsoup/tests/test_tree.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/beautifulsoup/tests/test_tree.py') diff --git a/src/beautifulsoup/tests/test_tree.py b/src/beautifulsoup/tests/test_tree.py index 191ec59..9e0dbc5 100644 --- a/src/beautifulsoup/tests/test_tree.py +++ b/src/beautifulsoup/tests/test_tree.py @@ -35,7 +35,15 @@ class TreeTest(SoupTest): class TestFind(TreeTest): - """Basic tests of the find() method.""" + """Basic tests of the find() method. + + find() just calls findAll() with limit=1, so it's not tested all + that thouroughly here. + """ + + def test_find_tag(self): + soup = self.soup("1234") + self.assertEqual(soup.find("b").string, "2") def test_unicode_text_find(self): soup = self.soup(u'

Räksmörgås

') @@ -296,9 +304,9 @@ class TestNextOperations(TreeTest): last = self.tree.find(text="Three") self.assertEquals(last.next, None) - # XXX This doesn't actually work. - #def test_next_of_root_is_first_item(self): - # self.assertEquals(self.tree.next['id'], 'start') + def test_next_of_root_is_none(self): + # The document root is outside the next/previous chain. + self.assertEquals(self.tree.next, None) def test_find_all_next(self): self.assertSelects(self.start.findAllNext('b'), ["Two", "Three"]) -- cgit v1.2.3