@@ -591,7 +591,7 @@ def test_num_retries_is_not_none_by_default(self, get_con_mock):
591
591
}
592
592
self .assertEqual (self .instance .num_retries , 5 )
593
593
594
- @mock .patch ("airflow.providers.google.common.hooks.base_google.httplib2.Http " )
594
+ @mock .patch ("airflow.providers.google.common.hooks.base_google.build_http " )
595
595
@mock .patch ("airflow.providers.google.common.hooks.base_google.GoogleBaseHook._get_credentials" )
596
596
def test_authorize_assert_user_agent_is_sent (self , mock_get_credentials , mock_http ):
597
597
"""
@@ -616,6 +616,22 @@ def test_authorize_assert_user_agent_is_sent(self, mock_get_credentials, mock_ht
616
616
self .assertEqual (response , new_response )
617
617
self .assertEqual (content , new_content )
618
618
619
+ @mock .patch ("airflow.providers.google.common.hooks.base_google.GoogleBaseHook._get_credentials" )
620
+ def test_authorize_assert_http_308_is_excluded (self , mock_get_credentials ):
621
+ """
622
+ Verify that 308 status code is excluded from httplib2's redirect codes
623
+ """
624
+ http_authorized = self .instance ._authorize ().http
625
+ self .assertTrue (308 not in http_authorized .redirect_codes )
626
+
627
+ @mock .patch ("airflow.providers.google.common.hooks.base_google.GoogleBaseHook._get_credentials" )
628
+ def test_authorize_assert_http_timeout_is_present (self , mock_get_credentials ):
629
+ """
630
+ Verify that http client has a timeout set
631
+ """
632
+ http_authorized = self .instance ._authorize ().http
633
+ self .assertNotEqual (http_authorized .timeout , None )
634
+
619
635
620
636
class TestProvideAuthorizedGcloud (unittest .TestCase ):
621
637
def setUp (self ):
0 commit comments