(self)
| 952 | self.assertRaises(ValueError, tag.insert_before, tag) |
| 953 | |
| 954 | def test_replace_with(self): |
| 955 | soup = self.soup( |
| 956 | "<p>There's <b>no</b> business like <b>show</b> business</p>") |
| 957 | no, show = soup.find_all('b') |
| 958 | show.replace_with(no) |
| 959 | self.assertEqual( |
| 960 | soup.decode(), |
| 961 | self.document_for( |
| 962 | "<p>There's business like <b>no</b> business</p>")) |
| 963 | |
| 964 | self.assertEqual(show.parent, None) |
| 965 | self.assertEqual(no.parent, soup.p) |
| 966 | self.assertEqual(no.next_element, "no") |
| 967 | self.assertEqual(no.next_sibling, " business") |
| 968 | |
| 969 | def test_replace_first_child(self): |
| 970 | data = "<a><b></b><c></c></a>" |
nothing calls this directly
no test coverage detected