summaryrefslogtreecommitdiff
path: root/bs4/tests/test_tree.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2012-02-07 21:16:03 -0500
committerLeonard Richardson <leonard.richardson@canonical.com>2012-02-07 21:16:03 -0500
commit62d5de7f5ac4211b688665dd5912d4c4fd82e95c (patch)
tree46561d2abc0a7a8cd38322cacb3c6e78ef21e489 /bs4/tests/test_tree.py
parentb0508df41dbc5a848566c659d8882a772366bb84 (diff)
BeautifulSoup objects don't support move_before() or move_after.
Diffstat (limited to 'bs4/tests/test_tree.py')
-rw-r--r--bs4/tests/test_tree.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py
index fe454d8..97dc5e6 100644
--- a/bs4/tests/test_tree.py
+++ b/bs4/tests/test_tree.py
@@ -682,11 +682,11 @@ class TestTreeModification(SoupTest):
soup = self.soup("<a>foo</a><b>bar</b>")
soup.new_string("BAZ").move_before(soup.b)
soup.new_string("QUUX").move_before(soup.a)
- self.assertEquals(
+ self.assertEqual(
soup.decode(), self.document_for("QUUX<a>foo</a>BAZ<b>bar</b>"))
soup.b.move_before(soup.a)
- self.assertEquals(
+ self.assertEqual(
soup.decode(), self.document_for("QUUX<b>bar</b><a>foo</a>BAZ"))
@@ -694,10 +694,10 @@ class TestTreeModification(SoupTest):
soup = self.soup("<a>foo</a><b>bar</b>")
soup.new_string("BAZ").move_after(soup.b)
soup.new_string("QUUX").move_after(soup.a)
- self.assertEquals(
+ self.assertEqual(
soup.decode(), self.document_for("<a>foo</a>QUUX<b>bar</b>BAZ"))
soup.a.move_after(soup.b)
- self.assertEquals(
+ self.assertEqual(
soup.decode(), self.document_for("QUUX<b>bar</b><a>foo</a>BAZ"))
def test_move_after_raises_valueerror_if_after_has_no_meaning(self):
@@ -706,12 +706,16 @@ class TestTreeModification(SoupTest):
string = soup.new_string("")
self.assertRaises(ValueError, string.move_after, tag)
+ self.assertRaises(ValueError, soup.move_after, tag)
+
def test_move_before_raises_valueerror_if_before_has_no_meaning(self):
soup = self.soup("")
tag = soup.new_tag("a")
string = soup.new_string("")
self.assertRaises(ValueError, string.move_before, tag)
+ self.assertRaises(ValueError, soup.move_before, tag)
+
def test_replace_with(self):
soup = self.soup(
"<p>There's <b>no</b> business like <b>show</b> business</p>")