@@ -70,10 +70,10 @@ async def send(request, **kwargs):
7070
7171
7272class TestWorkloadIdentityCredentialTokenProxyAsync :
73- """Async test cases for WorkloadIdentityCredential with use_token_proxy =True."""
73+ """Async test cases for WorkloadIdentityCredential with enable_azure_proxy =True."""
7474
75- def test_use_token_proxy_creates_custom_aiohttp_transport (self ):
76- """Test that use_token_proxy =True creates a custom aiohttp transport with correct parameters."""
75+ def test_enable_azure_proxy_creates_custom_aiohttp_transport (self ):
76+ """Test that enable_azure_proxy =True creates a custom aiohttp transport with correct parameters."""
7777 tenant_id = "tenant-id"
7878 client_id = "client-id"
7979 token_file_path = "foo-path"
@@ -96,7 +96,7 @@ def test_use_token_proxy_creates_custom_aiohttp_transport(self):
9696 tenant_id = tenant_id ,
9797 client_id = client_id ,
9898 token_file_path = token_file_path ,
99- use_token_proxy = True ,
99+ enable_azure_proxy = True ,
100100 )
101101
102102 mock_get_transport .assert_called_once_with (
@@ -106,8 +106,8 @@ def test_use_token_proxy_creates_custom_aiohttp_transport(self):
106106 ca_data = None ,
107107 )
108108
109- def test_use_token_proxy_with_ca_data (self ):
110- """Test use_token_proxy with CA data instead of CA file."""
109+ def test_enable_azure_proxy_with_ca_data (self ):
110+ """Test enable_azure_proxy with CA data instead of CA file."""
111111 tenant_id = "tenant-id"
112112 client_id = "client-id"
113113 token_file_path = "foo-path"
@@ -128,7 +128,7 @@ def test_use_token_proxy_with_ca_data(self):
128128 tenant_id = tenant_id ,
129129 client_id = client_id ,
130130 token_file_path = token_file_path ,
131- use_token_proxy = True ,
131+ enable_azure_proxy = True ,
132132 )
133133 mock_get_transport .assert_called_once_with (
134134 sni = None ,
@@ -137,8 +137,8 @@ def test_use_token_proxy_with_ca_data(self):
137137 ca_data = ca_data ,
138138 )
139139
140- def test_use_token_proxy_minimal_config (self ):
141- """Test use_token_proxy with minimal configuration (only proxy endpoint)."""
140+ def test_enable_azure_proxy_minimal_config (self ):
141+ """Test enable_azure_proxy with minimal configuration (only proxy endpoint)."""
142142 tenant_id = "tenant-id"
143143 client_id = "client-id"
144144 token_file_path = "foo-path"
@@ -157,7 +157,7 @@ def test_use_token_proxy_minimal_config(self):
157157 tenant_id = tenant_id ,
158158 client_id = client_id ,
159159 token_file_path = token_file_path ,
160- use_token_proxy = True ,
160+ enable_azure_proxy = True ,
161161 )
162162
163163 mock_get_transport .assert_called_once_with (
@@ -167,8 +167,8 @@ def test_use_token_proxy_minimal_config(self):
167167 ca_data = None ,
168168 )
169169
170- def test_use_token_proxy_missing_proxy_endpoint (self ):
171- """Test that use_token_proxy =True without proxy endpoint uses the normal transport."""
170+ def test_enable_azure_proxy_missing_proxy_endpoint (self ):
171+ """Test that enable_azure_proxy =True without proxy endpoint uses the normal transport."""
172172 tenant_id = "tenant-id"
173173 client_id = "client-id"
174174 token_file_path = "foo-path"
@@ -183,11 +183,11 @@ def test_use_token_proxy_missing_proxy_endpoint(self):
183183 tenant_id = tenant_id ,
184184 client_id = client_id ,
185185 token_file_path = token_file_path ,
186- use_token_proxy = True ,
186+ enable_azure_proxy = True ,
187187 )
188188 mock_get_transport .assert_not_called ()
189189
190- def test_use_token_proxy_both_ca_file_and_data_raises_error (self ):
190+ def test_enable_azure_proxy_both_ca_file_and_data_raises_error (self ):
191191 """Test that setting both CA file and CA data raises ValueError."""
192192 tenant_id = "tenant-id"
193193 client_id = "client-id"
@@ -208,11 +208,11 @@ def test_use_token_proxy_both_ca_file_and_data_raises_error(self):
208208 tenant_id = tenant_id ,
209209 client_id = client_id ,
210210 token_file_path = token_file_path ,
211- use_token_proxy = True ,
211+ enable_azure_proxy = True ,
212212 )
213213
214- def test_use_token_proxy_missing_endpoint_with_custom_env_vars_raises_error (self ):
215- """Test that use_token_proxy =True without proxy endpoint but with other custom env vars raises ValueError."""
214+ def test_enable_azure_proxy_missing_endpoint_with_custom_env_vars_raises_error (self ):
215+ """Test that enable_azure_proxy =True without proxy endpoint but with other custom env vars raises ValueError."""
216216 tenant_id = "tenant-id"
217217 client_id = "client-id"
218218 token_file_path = "foo-path"
@@ -234,7 +234,7 @@ def test_use_token_proxy_missing_endpoint_with_custom_env_vars_raises_error(self
234234 tenant_id = tenant_id ,
235235 client_id = client_id ,
236236 token_file_path = token_file_path ,
237- use_token_proxy = True ,
237+ enable_azure_proxy = True ,
238238 )
239239
240240 # Test with CA file set but no proxy endpoint
@@ -247,7 +247,7 @@ def test_use_token_proxy_missing_endpoint_with_custom_env_vars_raises_error(self
247247 tenant_id = tenant_id ,
248248 client_id = client_id ,
249249 token_file_path = token_file_path ,
250- use_token_proxy = True ,
250+ enable_azure_proxy = True ,
251251 )
252252
253253 # Test with CA data set but no proxy endpoint
@@ -260,12 +260,12 @@ def test_use_token_proxy_missing_endpoint_with_custom_env_vars_raises_error(self
260260 tenant_id = tenant_id ,
261261 client_id = client_id ,
262262 token_file_path = token_file_path ,
263- use_token_proxy = True ,
263+ enable_azure_proxy = True ,
264264 )
265265
266266 @pytest .mark .asyncio
267267 @pytest .mark .parametrize ("get_token_method" , GET_TOKEN_METHODS )
268- async def test_use_token_proxy_get_token_success (self , get_token_method ):
268+ async def test_enable_azure_proxy_get_token_success (self , get_token_method ):
269269 """Test successful token acquisition when using token proxy."""
270270 tenant_id = "tenant-id"
271271 client_id = "client-id"
@@ -294,7 +294,7 @@ async def send(request, **kwargs):
294294 tenant_id = tenant_id ,
295295 client_id = client_id ,
296296 token_file_path = token_file_path ,
297- use_token_proxy = True ,
297+ enable_azure_proxy = True ,
298298 )
299299
300300 open_mock = mock_open (read_data = assertion )
@@ -304,8 +304,8 @@ async def send(request, **kwargs):
304304
305305 open_mock .assert_called_once_with (token_file_path , encoding = "utf-8" )
306306
307- def test_use_token_proxy_false_does_not_create_transport (self ):
308- """Test that use_token_proxy =False (default) does not create a custom transport."""
307+ def test_enable_azure_proxy_false_does_not_create_transport (self ):
308+ """Test that enable_azure_proxy =False (default) does not create a custom transport."""
309309 tenant_id = "tenant-id"
310310 client_id = "client-id"
311311 token_file_path = "foo-path"
@@ -315,7 +315,7 @@ def test_use_token_proxy_false_does_not_create_transport(self):
315315 tenant_id = tenant_id ,
316316 client_id = client_id ,
317317 token_file_path = token_file_path ,
318- use_token_proxy = False ,
318+ enable_azure_proxy = False ,
319319 )
320320 mock_get_transport .assert_not_called ()
321321
0 commit comments