Skip to content

Commit b7bdfde

Browse files
author
Aviat Cohen
committed
mock acquire_token method
1 parent 64838f0 commit b7bdfde

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/test_commands/conftest.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,10 +897,19 @@ def mock_fab_logger_log_warning():
897897
def mock_get_access_token(vcr_mode):
898898
if vcr_mode == "none":
899899
fab_auth_instance = FabAuth() # Singleton
900+
901+
# Mock MSAL token result for acquire_token (used by MSAL bridge)
902+
mock_msal_result = {
903+
"access_token": "mocked_access_token",
904+
"expires_in": 3600
905+
}
906+
900907
with patch.object(
901908
fab_auth_instance, "get_access_token", return_value="mocked_access_token"
902-
) as mock:
903-
yield mock
909+
) as mock_get_token, patch.object(
910+
fab_auth_instance, "acquire_token", return_value=mock_msal_result
911+
) as mock_acquire_token:
912+
yield {"get_access_token": mock_get_token, "acquire_token": mock_acquire_token}
904913
else:
905914
yield
906915

0 commit comments

Comments
 (0)