File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 1818import msal
1919import getpass
2020import os
21- import warnings
2221try :
2322 from dotenv import load_dotenv # Use this only in local dev machine
2423 load_dotenv () # take environment variables from .env.
@@ -75,10 +74,12 @@ def test_broker_username_password(scopes, expected_token_type):
7574 assert username and password , "You need to provide a test account and its password"
7675 result = pca .acquire_token_by_username_password (username , password , scopes )
7776 _assert (result , expected_token_type )
77+ assert result .get ("token_source" ) == "broker"
7878 print ("Username password test succeeds." )
7979
8080def _assert (result , expected_token_type ):
8181 assert result .get ("access_token" ), f"We should obtain a token. Got { result } instead."
82+ assert result .get ("token_source" ) == "broker" , "Token should be obtained via broker"
8283 assert result .get ("token_type" ).lower () == expected_token_type .lower (), f"{ expected_token_type } not found"
8384
8485for i in range (2 ): # Mimic Azure CLI's issue report
You can’t perform that action at this time.
0 commit comments