(content, reset=None)
| 111 | |
| 112 | @staticmethod |
| 113 | def response_func(content, reset=None): |
| 114 | def response(): |
| 115 | stream = BytesIO(content.encode("utf8")) |
| 116 | return urllib3.response.HTTPResponse( |
| 117 | body=stream, |
| 118 | preload_content=False, |
| 119 | headers={"X-RateLimit-Reset": f"{reset}"} if reset else {}, |
| 120 | status=403, |
| 121 | ) |
| 122 | |
| 123 | return response |
| 124 | |
| 125 | @contextlib.contextmanager |
| 126 | def mock_retry_now(self, now): |
no outgoing calls