Parsers should be able to work with SoupStrainers.
(self)
| 371 | self.assertEqual('Sacr\xe9 bleu!', soup.body.string) |
| 372 | |
| 373 | def test_soupstrainer(self): |
| 374 | """Parsers should be able to work with SoupStrainers.""" |
| 375 | strainer = SoupStrainer("b") |
| 376 | soup = self.soup("A <b>bold</b> <meta/> <i>statement</i>", |
| 377 | parse_only=strainer) |
| 378 | self.assertEqual(soup.decode(), "<b>bold</b>") |
| 379 | |
| 380 | def test_single_quote_attribute_values_become_double_quotes(self): |
| 381 | self.assertSoupEquals("<foo attr='bar'></foo>", |
nothing calls this directly
no test coverage detected