MCPcopy Create free account
hub / github.com/gawel/pyquery / test_replaceWith_with_function

Method test_replaceWith_with_function

tests/test_pyquery.py:812–821  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

810 assert val == expected, (repr(val), repr(expected))
811
812 def test_replaceWith_with_function(self):
813 expected = ''&#x27;<div class="portlet">
814 TestimageMy link text
815 imageMy link text 2
816 Behind you, a three-headed HTML&amp;dash;Entity!
817 </div>''&#x27;
818 d = pq(self.html)
819 d('a').replace_with(lambda i, e: pq(e).html())
820 val = d.__html__()
821 assert val == expected, (repr(val), repr(expected))
822
823
824class TestXMLNamespace(TestCase):

Callers

nothing calls this directly

Calls 3

replace_withMethod · 0.80
htmlMethod · 0.80
__html__Method · 0.80

Tested by

no test coverage detected