MCPcopy
hub / github.com/scrapy/scrapy / request

Method request

tests/test_engine_loop.py:125–128  ·  view source on GitHub ↗
(self, num, response_seconds, download_slots, priority=0)

Source from the content-addressed store, hash-verified

123 cls.mockserver.__exit__(None, None, None) # increase if flaky
124
125 def request(self, num, response_seconds, download_slots, priority=0):
126 url = self.mockserver.url(f"/delay?n={response_seconds}&{num}")
127 meta = {"download_slot": str(num % download_slots)}
128 return Request(url, meta=meta, priority=priority)
129
130 def get_num(self, request_or_response: Request | Response):
131 return int(request_or_response.url.rsplit("&", maxsplit=1)[1])

Callers 6

_test_request_orderMethod · 0.95
start_fnMethod · 0.95
_requestMethod · 0.95
startMethod · 0.95
get_pageMethod · 0.45
make_request_dfdFunction · 0.45

Calls 2

RequestClass · 0.90
urlMethod · 0.45

Tested by

no test coverage detected