| 30 | |
| 31 | def mocked_req_post(*args, **kwargs): |
| 32 | class MockResponse: |
| 33 | def __init__(self, url=None, json_in=None, status_code=None): |
| 34 | self.url = url |
| 35 | self.json_in = json_in |
| 36 | self.status_code = status_code |
| 37 | |
| 38 | def json(self): |
| 39 | return self.json_in |
| 40 | |
| 41 | def raise_for_status(self): |
| 42 | if self.status_code != OK_STATUS: |
| 43 | raise requests.exceptions.HTTPError(HTTP_ERROR_MSG) |
| 44 | url = args[0] |
| 45 | if url == REQUEST_TOKEN_URL: |
| 46 | return MockResponse(url, OAUTH2_RESPONSE_BOGUS_BUT_OK, 200) |
no outgoing calls