Conversation
…auto-refreshing tokens on 401 errors; update README and CHANGELOG accordingly.
…for-xurrent Add OAuth client credentials support to API helper
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
…s and updating comments for clarity
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| def fake_request(method, url, headers=None, json=None): | ||
| api_responses.append({"method": method, "url": url, "headers": headers, "json": json}) | ||
| response = MagicMock() | ||
| response.status_code = 200 | ||
| response.ok = True | ||
| response.json.return_value = {"result": "ok"} | ||
| response.headers = {} | ||
| return response | ||
|
|
||
| monkeypatch.setattr(requests, "post", fake_post) | ||
| monkeypatch.setattr(requests, "request", fake_request) | ||
|
|
There was a problem hiding this comment.
Monkeypatched requests function never runs
Both OAuth tests replace requests.request, but XurrentApiHelper.api_call always uses the helper’s requests.Session (self.__session.request). The monkeypatch therefore never intercepts the call and the tests will perform a real HTTP request to api.example.com, causing them to fail or require network access. Patch requests.Session.request (or the helper’s session) instead so the tests stay hermetic and exercise the code path.
Useful? React with 👍 / 👎.
Added
client_idandclient_secretinXurrentApiHelperwhile maintaining API key compatibility.