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

Method test_replaceWith

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

Source from the content-addressed store, hash-verified

799 d.after(self.html) # this should not fail
800
801 def test_replaceWith(self):
802 expected = ''&#x27;<div class="portlet">
803 <a href="/toto">TestimageMy link text</a>
804 <a href="/toto2">imageMy link text 2</a>
805 Behind you, a three-headed HTML&amp;dash;Entity!
806 </div>''&#x27;
807 d = pq(self.html)
808 d('img').replace_with('image')
809 val = d.__html__()
810 assert val == expected, (repr(val), repr(expected))
811
812 def test_replaceWith_with_function(self):
813 expected = ''&#x27;<div class="portlet">

Callers

nothing calls this directly

Calls 2

replace_withMethod · 0.80
__html__Method · 0.80

Tested by

no test coverage detected