File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
airbyte_cdk/sources/streams/http
unit_tests/sources/streams/http Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -562,7 +562,7 @@ def send_request(
562562
563563 env_settings = self ._session .merge_environment_settings (
564564 url = request .url ,
565- proxies = request_kwargs .get ("proxies" ),
565+ proxies = request_kwargs .get ("proxies" , {} ),
566566 stream = request_kwargs .get ("stream" ),
567567 verify = request_kwargs .get ("verify" ),
568568 cert = request_kwargs .get ("cert" ),
Original file line number Diff line number Diff line change @@ -747,6 +747,20 @@ def test_given_different_headers_then_response_is_not_cached(requests_mock):
747747 assert second_response .json ()["test" ] == "second response"
748748
749749
750+ def test_given_noproxy_for_another_url_when_send_request_then_do_not_break (requests_mock ):
751+ http_client = HttpClient (name = "test" , logger = MagicMock (), use_cache = True )
752+ os .environ ["no_proxy" ] = "another.com"
753+ requests_mock .register_uri (
754+ "GET" ,
755+ "https://google.com/" ,
756+ json = {"test" : "a response" },
757+ )
758+
759+ x = http_client .send_request ("GET" , "https://google.com/" , request_kwargs = {})
760+
761+ assert x
762+
763+
750764@patch .dict ("os.environ" , {"REQUESTS_CA_BUNDLE" : "/path/to/ca-bundle.crt" })
751765def test_send_request_respects_environment_variables ():
752766 """Test that send_request respects REQUESTS_CA_BUNDLE environment variable."""
You can’t perform that action at this time.
0 commit comments