MCPcopy
hub / github.com/scrapy/scrapy / test_follow_all_invalid

Method test_follow_all_invalid

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

Source from the content-addressed store, hash-verified

307 assert not list(r.follow_all([]))
308
309 def test_follow_all_invalid(self):
310 r = self.response_class("http://example.com")
311 if self.response_class == Response:
312 with pytest.raises(TypeError):
313 list(r.follow_all(urls=None))
314 with pytest.raises(TypeError):
315 list(r.follow_all(urls=12345))
316 with pytest.raises(ValueError, match="url can't be None"):
317 list(r.follow_all(urls=[None]))
318 else:
319 with pytest.raises(
320 ValueError, match="Please supply exactly one of the following arguments"
321 ):
322 list(r.follow_all(urls=None))
323 with pytest.raises(TypeError):
324 list(r.follow_all(urls=12345))
325 with pytest.raises(ValueError, match="url can't be None"):
326 list(r.follow_all(urls=[None]))
327
328 def test_follow_all_whitespace(self):
329 relative = ["foo ", "bar ", "foo/bar ", "bar/foo "]

Callers

nothing calls this directly

Calls 1

follow_allMethod · 0.45

Tested by

no test coverage detected