-
Notifications
You must be signed in to change notification settings - Fork 839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #1333 Enable using RetryHandler for 200 OK response patterns #1334
Conversation
@@ -28,7 +28,7 @@ def tearDown(self): | |||
def test_sync(self): | |||
client = self.sync_client | |||
|
|||
response = client.admin_analytics_getFile(date="2020-10-20", type="member") | |||
response = client.admin_analytics_getFile(date="2022-10-20", type="member") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the old date no longer works for my sandbox org, let me change the date here
@@ -40,7 +40,7 @@ def test_issue_594(self): | |||
external_id=external_id, | |||
external_url=external_url, | |||
title="Good Old Slack Logo", | |||
indexable_file_contents="Good Old Slack Logo", | |||
indexable_file_contents="Good Old Slack Logo".encode("utf-8"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test code needed to be changed when I fixed the code back then
@@ -147,24 +147,20 @@ def convert_params(values: dict) -> dict: | |||
f"body: {body}" | |||
) | |||
|
|||
if res.status == 429: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the if condition to check http status
@@ -396,7 +396,29 @@ def _perform_urllib_http_request(self, *, url: str, args: Dict[str, Dict[str, An | |||
try: | |||
resp = self._perform_urllib_http_request_internal(url, req) | |||
# The resp is a 200 OK response | |||
return resp | |||
if len(self.retry_handlers) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added retry handler support for 200 OK responses here
@@ -98,17 +98,37 @@ def _handle(self): | |||
return | |||
|
|||
header = self.headers["Authorization"] | |||
if header is not None and "xoxp-" in header: | |||
pattern = str(header).split("xoxp-", 1)[1] | |||
if header is not None and ("xoxb-" in header or "xoxp-" in header): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improved the mock server for unit tests
@@ -1,25 +0,0 @@ | |||
import unittest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed redundant and incomplete tests
Codecov Report
@@ Coverage Diff @@
## main #1334 +/- ##
==========================================
- Coverage 85.40% 85.39% -0.02%
==========================================
Files 111 111
Lines 11394 11406 +12
==========================================
+ Hits 9731 9740 +9
- Misses 1663 1666 +3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Summary
This pull request resolves #1333
Category (place an
x
in each of the[ ]
)/docs-src
(Documents, have you run./scripts/docs.sh
?)/docs-src-v2
(Documents, have you run./scripts/docs-v2.sh
?)/tutorial
(PythOnBoardingBot tutorial)tests
/integration_tests
(Automated tests for this library)Requirements (place an
x
in each[ ]
)python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh
after making the changes.