@@ -45,8 +45,8 @@ def _get_fmi_credential_from_rma():
4545 authority = _AUTHORITY_URL ,
4646 http_client = MinimalHttpClient (),
4747 )
48- result = app .acquire_token_for_client_with_fmi_path (
49- [_FMI_SCOPE_FOR_RMA ], _FMI_PATH )
48+ result = app .acquire_token_for_client (
49+ [_FMI_SCOPE_FOR_RMA ], fmi_path = _FMI_PATH )
5050 if "access_token" not in result :
5151 raise RuntimeError (
5252 "Failed to acquire FMI token from RMA: {}: {}" .format (
@@ -73,17 +73,17 @@ def test_acquire_and_cache_with_fmi_path(self):
7373 scopes = [_FMI_SCOPE ]
7474
7575 # 1. Acquire token by credential with FMI path
76- result = app .acquire_token_for_client_with_fmi_path (scopes , _FMI_PATH )
76+ result = app .acquire_token_for_client (scopes , fmi_path = _FMI_PATH )
7777 self .assertIn ("access_token" , result ,
78- "acquire_token_for_client_with_fmi_path( ) failed: {}: {}" .format (
78+ "acquire_token_for_client(fmi_path=... ) failed: {}: {}" .format (
7979 result .get ("error" ), result .get ("error_description" )))
8080 self .assertNotEqual ("" , result ["access_token" ],
81- "acquire_token_for_client_with_fmi_path( ) returned empty access token" )
81+ "acquire_token_for_client(fmi_path=... ) returned empty access token" )
8282
8383 first_token = result ["access_token" ]
8484
8585 # 2. Verify silent token acquisition works (should retrieve from cache)
86- cache_result = app .acquire_token_for_client_with_fmi_path (scopes , _FMI_PATH )
86+ cache_result = app .acquire_token_for_client (scopes , fmi_path = _FMI_PATH )
8787 self .assertIn ("access_token" , cache_result ,
8888 "Second call failed: {}: {}" .format (
8989 cache_result .get ("error" ), cache_result .get ("error_description" )))
@@ -124,16 +124,16 @@ def test_acquire_with_assertion_callback_and_fmi_path(self):
124124 fmi_path = "SomeFmiPath/Path"
125125
126126 # 1. Acquire token by credential with FMI path
127- result = app .acquire_token_for_client_with_fmi_path (scopes , fmi_path )
127+ result = app .acquire_token_for_client (scopes , fmi_path = fmi_path )
128128 self .assertIn ("access_token" , result ,
129- "acquire_token_for_client_with_fmi_path( ) failed: {}: {}" .format (
129+ "acquire_token_for_client(fmi_path=... ) failed: {}: {}" .format (
130130 result .get ("error" ), result .get ("error_description" )))
131131 self .assertNotEqual ("" , result ["access_token" ],
132- "acquire_token_for_client_with_fmi_path( ) returned empty access token" )
132+ "acquire_token_for_client(fmi_path=... ) returned empty access token" )
133133 first_token = result ["access_token" ]
134134
135135 # 2. Verify cached token acquisition works
136- cache_result = app .acquire_token_for_client_with_fmi_path (scopes , fmi_path )
136+ cache_result = app .acquire_token_for_client (scopes , fmi_path = fmi_path )
137137 self .assertIn ("access_token" , cache_result ,
138138 "Second call failed: {}: {}" .format (
139139 cache_result .get ("error" ), cache_result .get ("error_description" )))
@@ -166,15 +166,15 @@ def test_different_fmi_paths_are_cached_separately(self):
166166 scopes = [_FMI_SCOPE ]
167167
168168 # Acquire token with path A
169- result_a = app .acquire_token_for_client_with_fmi_path (
170- scopes , "PathA/credential" )
169+ result_a = app .acquire_token_for_client (
170+ scopes , fmi_path = "PathA/credential" )
171171 self .assertIn ("access_token" , result_a ,
172172 "Path A acquisition failed: {}: {}" .format (
173173 result_a .get ("error" ), result_a .get ("error_description" )))
174174
175175 # Acquire token with path B — should NOT get path A's cached token
176- result_b = app .acquire_token_for_client_with_fmi_path (
177- scopes , "PathB/credential" )
176+ result_b = app .acquire_token_for_client (
177+ scopes , fmi_path = "PathB/credential" )
178178 self .assertIn ("access_token" , result_b ,
179179 "Path B acquisition failed: {}: {}" .format (
180180 result_b .get ("error" ), result_b .get ("error_description" )))
@@ -183,8 +183,8 @@ def test_different_fmi_paths_are_cached_separately(self):
183183 "Different FMI path should NOT return cached token from another path" )
184184
185185 # Verify path A still returns its own cached token
186- result_a2 = app .acquire_token_for_client_with_fmi_path (
187- scopes , "PathA/credential" )
186+ result_a2 = app .acquire_token_for_client (
187+ scopes , fmi_path = "PathA/credential" )
188188 self .assertIn ("access_token" , result_a2 )
189189 self .assertEqual (
190190 result_a2 .get ("token_source" ), "cache" ,
@@ -201,7 +201,7 @@ def test_fmi_token_does_not_interfere_with_non_fmi_token(self):
201201 scopes = [_FMI_SCOPE ]
202202
203203 # Cache a token via FMI path
204- fmi_result = app .acquire_token_for_client_with_fmi_path (scopes , _FMI_PATH )
204+ fmi_result = app .acquire_token_for_client (scopes , fmi_path = _FMI_PATH )
205205 self .assertIn ("access_token" , fmi_result )
206206
207207 # Regular acquire_token_for_client should NOT get the FMI token
@@ -230,14 +230,14 @@ def test_two_fmi_paths_produce_separate_cache_entries(self):
230230 path_b = "PathBeta/Credential"
231231
232232 # 1. Acquire token with path A
233- result_a = app .acquire_token_for_client_with_fmi_path (scopes , path_a )
233+ result_a = app .acquire_token_for_client (scopes , fmi_path = path_a )
234234 self .assertIn ("access_token" , result_a ,
235235 "Path A acquisition failed: {}: {}" .format (
236236 result_a .get ("error" ), result_a .get ("error_description" )))
237237 token_a = result_a ["access_token" ]
238238
239239 # 2. Acquire token with path B
240- result_b = app .acquire_token_for_client_with_fmi_path (scopes , path_b )
240+ result_b = app .acquire_token_for_client (scopes , fmi_path = path_b )
241241 self .assertIn ("access_token" , result_b ,
242242 "Path B acquisition failed: {}: {}" .format (
243243 result_b .get ("error" ), result_b .get ("error_description" )))
@@ -268,12 +268,12 @@ def test_two_fmi_paths_produce_separate_cache_entries(self):
268268 "ext_cache_key values for different FMI paths must differ" )
269269
270270 # 5. Verify each path still returns its own cached token
271- cached_a = app .acquire_token_for_client_with_fmi_path (scopes , path_a )
271+ cached_a = app .acquire_token_for_client (scopes , fmi_path = path_a )
272272 self .assertEqual ("cache" , cached_a .get ("token_source" ))
273273 self .assertEqual (token_a , cached_a ["access_token" ],
274274 "Path A should return its own cached token" )
275275
276- cached_b = app .acquire_token_for_client_with_fmi_path (scopes , path_b )
276+ cached_b = app .acquire_token_for_client (scopes , fmi_path = path_b )
277277 self .assertEqual ("cache" , cached_b .get ("token_source" ))
278278 self .assertEqual (token_b , cached_b ["access_token" ],
279279 "Path B should return its own cached token" )
0 commit comments