Fix #1333 Enable using RetryHandler for 200 OK response patterns#1334
Fix #1333 Enable using RetryHandler for 200 OK response patterns#1334seratch merged 2 commits intoslackapi:mainfrom
Conversation
| 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.
Since the old date no longer works for my sandbox org, let me change the date here
| 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.
This test code needed to be changed when I fixed the code back then
| f"body: {body}" | ||
| ) | ||
|
|
||
| if res.status == 429: |
There was a problem hiding this comment.
Removed the if condition to check http status
| 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.
Added retry handler support for 200 OK responses here
| 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.
Improved the mock server for unit tests
| @@ -1,25 +0,0 @@ | |||
| import unittest | |||
There was a problem hiding this comment.
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
xin 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
xin each[ ])python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.shafter making the changes.