summaryrefslogtreecommitdiff
path: root/bs4/tests/test_tree.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2012-08-20 14:10:29 -0400
committerLeonard Richardson <leonardr@segfault.org>2012-08-20 14:10:29 -0400
commit0f1e8f4a18ea9e48bc05abdb0a0eb2a75c46f714 (patch)
tree9df818fd3afe7c135fc3ffc9204508ca02f6e3e8 /bs4/tests/test_tree.py
parent84088ed20f516366b272e05f7f7ccd55c446c178 (diff)
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]
Diffstat (limited to 'bs4/tests/test_tree.py')
-rw-r--r--bs4/tests/test_tree.py8
1 files changed, 4 insertions, 4 deletions
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("QUUX<b>bar</b><a>foo</a>BAZ"))
- 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):