Esempio n. 1
0
 def extract_cookiejar(self):
     jar = CookieJar()
     # self._respose could be None
     # if this method is called from custom preapre response
     # function called from spider cache backend
     if self._response and self._request:
         jar.extract_cookies(
             MockResponse(self._response._original_response.msg),
             MockRequest(self._request),
         )
     return jar
Esempio n. 2
0
 def extract_cookiejar(self):
     jar = CookieJar()
     # self._respose could be None
     # if this method is called from custom preapre response
     if self._response and self._request:
         jar.extract_cookies(
             # pylint: disable=protected-access
             MockResponse(self._response._original_response.msg),
             # pylint: enable=protected-access
             MockRequest(self._request),
         )
     return jar
Esempio n. 3
0
 def extract_cookiejar(self, resp, req):
     jar = CookieJar()
     jar.extract_cookies(MockResponse(resp._original_response.msg),
                         MockRequest(req))
     return jar