MCPcopy
hub / github.com/scrapy/scrapy / test_shortcut_attributes

Method test_shortcut_attributes

tests/test_http_response.py:216–231  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

214 assert joined == absolute
215
216 def test_shortcut_attributes(self):
217 r = self.response_class("http://example.com", body=b"hello")
218 if self.response_class == Response:
219 msg = "Response content isn't text"
220 with pytest.raises(AttributeError, match=msg):
221 r.text
222 with pytest.raises(NotSupported, match=msg):
223 r.css("body")
224 with pytest.raises(NotSupported, match=msg):
225 r.xpath("//body")
226 with pytest.raises(NotSupported, match=msg):
227 r.jmespath("body")
228 else:
229 r.text
230 r.css("body")
231 r.xpath("//body")
232
233 # Response.follow
234

Callers

nothing calls this directly

Calls 3

cssMethod · 0.45
xpathMethod · 0.45
jmespathMethod · 0.45

Tested by

no test coverage detected