@@ -1806,7 +1806,6 @@ def test_update_dataset(self):
1806
1806
"access" : ACCESS ,
1807
1807
},
1808
1808
path = "/" + PATH ,
1809
- headers = None ,
1810
1809
timeout = 7.5 ,
1811
1810
)
1812
1811
self .assertEqual (ds2 .description , ds .description )
@@ -1850,7 +1849,6 @@ def test_update_dataset_w_custom_property(self):
1850
1849
method = "PATCH" ,
1851
1850
data = {"newAlphaProperty" : "unreleased property" },
1852
1851
path = path ,
1853
- headers = None ,
1854
1852
timeout = DEFAULT_TIMEOUT ,
1855
1853
)
1856
1854
@@ -1909,7 +1907,7 @@ def test_update_model(self):
1909
1907
"labels" : {"x" : "y" },
1910
1908
}
1911
1909
conn .api_request .assert_called_once_with (
1912
- method = "PATCH" , data = sent , path = "/" + path , headers = None , timeout = 7.5
1910
+ method = "PATCH" , data = sent , path = "/" + path , timeout = 7.5
1913
1911
)
1914
1912
self .assertEqual (updated_model .model_id , model .model_id )
1915
1913
self .assertEqual (updated_model .description , model .description )
@@ -1982,7 +1980,6 @@ def test_update_routine(self):
1982
1980
method = "PUT" ,
1983
1981
data = sent ,
1984
1982
path = "/projects/routines-project/datasets/test_routines/routines/updated_routine" ,
1985
- headers = None ,
1986
1983
timeout = 7.5 ,
1987
1984
)
1988
1985
self .assertEqual (actual_routine .arguments , routine .arguments )
@@ -2090,7 +2087,7 @@ def test_update_table(self):
2090
2087
"labels" : {"x" : "y" },
2091
2088
}
2092
2089
conn .api_request .assert_called_once_with (
2093
- method = "PATCH" , data = sent , path = "/" + path , headers = None , timeout = 7.5
2090
+ method = "PATCH" , data = sent , path = "/" + path , timeout = 7.5
2094
2091
)
2095
2092
self .assertEqual (updated_table .description , table .description )
2096
2093
self .assertEqual (updated_table .friendly_name , table .friendly_name )
@@ -2140,7 +2137,6 @@ def test_update_table_w_custom_property(self):
2140
2137
method = "PATCH" ,
2141
2138
path = "/%s" % path ,
2142
2139
data = {"newAlphaProperty" : "unreleased property" },
2143
- headers = None ,
2144
2140
timeout = DEFAULT_TIMEOUT ,
2145
2141
)
2146
2142
self .assertEqual (
@@ -2175,7 +2171,6 @@ def test_update_table_only_use_legacy_sql(self):
2175
2171
method = "PATCH" ,
2176
2172
path = "/%s" % path ,
2177
2173
data = {"view" : {"useLegacySql" : True }},
2178
- headers = None ,
2179
2174
timeout = DEFAULT_TIMEOUT ,
2180
2175
)
2181
2176
self .assertEqual (updated_table .view_use_legacy_sql , table .view_use_legacy_sql )
@@ -2273,7 +2268,6 @@ def test_update_table_w_query(self):
2273
2268
"expirationTime" : str (_millis (exp_time )),
2274
2269
"schema" : schema_resource ,
2275
2270
},
2276
- headers = None ,
2277
2271
timeout = DEFAULT_TIMEOUT ,
2278
2272
)
2279
2273
@@ -8173,3 +8167,20 @@ def transmit_next_chunk(transport):
8173
8167
8174
8168
chunk_size = RU .call_args_list [0 ][0 ][1 ]
8175
8169
assert chunk_size == 100 * (1 << 20 )
8170
+
8171
+
8172
+ @pytest .mark .enable_add_server_timeout_header
8173
+ @pytest .mark .parametrize ("headers" , [None , {}])
8174
+ def test__call_api_add_server_timeout_w_timeout (client , headers ):
8175
+ client ._connection = make_connection ({})
8176
+ client ._call_api (None , method = "GET" , path = "/" , headers = headers , timeout = 42 )
8177
+ client ._connection .api_request .assert_called_with (
8178
+ method = "GET" , path = "/" , timeout = 42 , headers = {"X-Server-Timeout" : "42" }
8179
+ )
8180
+
8181
+
8182
+ @pytest .mark .enable_add_server_timeout_header
8183
+ def test__call_api_no_add_server_timeout_wo_timeout (client ):
8184
+ client ._connection = make_connection ({})
8185
+ client ._call_api (None , method = "GET" , path = "/" )
8186
+ client ._connection .api_request .assert_called_with (method = "GET" , path = "/" )
0 commit comments