From 0f1e8f4a18ea9e48bc05abdb0a0eb2a75c46f714 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Mon, 20 Aug 2012 14:10:29 -0400 Subject: Raise a more specific error (FeatureNotFound) when a requested parser or parser feature is not installed. Raise NotImplementedError instead of ValueError when the user calls insert_before() or insert_after() on the BeautifulSoup object itself. Patch by Aaron Devore. [bug=1038301] --- bs4/tests/test_tree.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bs4/tests/test_tree.py') diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py index 9397f24..5f3395b 100644 --- a/bs4/tests/test_tree.py +++ b/bs4/tests/test_tree.py @@ -886,20 +886,20 @@ class TestTreeModification(SoupTest): self.assertEqual( soup.decode(), self.document_for("QUUXbarfooBAZ")) - def test_insert_after_raises_valueerror_if_after_has_no_meaning(self): + def test_insert_after_raises_exception_if_after_has_no_meaning(self): soup = self.soup("") tag = soup.new_tag("a") string = soup.new_string("") self.assertRaises(ValueError, string.insert_after, tag) - self.assertRaises(ValueError, soup.insert_after, tag) + self.assertRaises(NotImplementedError, soup.insert_after, tag) self.assertRaises(ValueError, tag.insert_after, tag) - def test_insert_before_raises_valueerror_if_before_has_no_meaning(self): + def test_insert_before_raises_notimplementederror_if_before_has_no_meaning(self): soup = self.soup("") tag = soup.new_tag("a") string = soup.new_string("") self.assertRaises(ValueError, string.insert_before, tag) - self.assertRaises(ValueError, soup.insert_before, tag) + self.assertRaises(NotImplementedError, soup.insert_before, tag) self.assertRaises(ValueError, tag.insert_before, tag) def test_replace_with(self): -- cgit v1.2.3