MCPcopy Index your code
hub / github.com/csev/py4e / test_soupstrainer

Method test_soupstrainer

code3/bs4/testing.py:373–378  ·  view source on GitHub ↗

Parsers should be able to work with SoupStrainers.

(self)

Source from the content-addressed store, hash-verified

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>",

Callers

nothing calls this directly

Calls 3

SoupStrainerClass · 0.90
soupMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected