-
Notifications
You must be signed in to change notification settings - Fork 30
feat(requests-ca): respect REQUESTS_CA_BUNDLE environment variable #755
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
Merged
+42
−2
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c2d0351
feat(requests-ca): respect REQUESTS_CA_BUNDLE environment variable
bosper351 98a7921
Auto-fix lint and format issues
8f0c03c
Merge branch 'main' into requests-env-settings
aaronsteers 8c745d7
Fix tests
bosper351 a69a137
Merge remote-tracking branch 'upstream/main' into requests-env-settings
bosper351 2c052e9
Fix format
bosper351 d1919ec
Fix tests
bosper351 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,10 @@ def test_requests_native_token_authenticator(): | |
|
||
def test_request_kwargs_used(mocker, requests_mock): | ||
stream = StubBasicReadHttpStream() | ||
request_kwargs = {"cert": None, "proxies": "google.com"} | ||
request_kwargs = { | ||
"cert": None, | ||
"proxies": {"http": "http://example.com", "https": "http://example.com"}, | ||
} | ||
mocker.patch.object(stream, "request_kwargs", return_value=request_kwargs) | ||
send_mock = mocker.patch.object( | ||
stream._http_client._session, "send", wraps=stream._http_client._session.send | ||
|
@@ -101,8 +104,16 @@ def test_request_kwargs_used(mocker, requests_mock): | |
|
||
list(stream.read_records(sync_mode=SyncMode.full_refresh)) | ||
|
||
stream._http_client._session.send.assert_any_call(ANY, **request_kwargs) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
assert send_mock.call_count == 1 | ||
call_args = send_mock.call_args_list[0] | ||
call_kwargs = call_args.kwargs | ||
|
||
assert call_kwargs.get("cert") is None | ||
|
||
proxies = call_kwargs.get("proxies") | ||
assert proxies is not None | ||
assert proxies["http"] == "http://example.com" | ||
assert proxies["https"] == "http://example.com" | ||
|
||
|
||
def test_stub_basic_read_http_stream_read_records(mocker): | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.