Skip to content

Commit 0961248

Browse files
committed
edit
1 parent 6cae429 commit 0961248

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/broker-test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import msal
1919
import getpass
2020
import os
21-
import warnings
2221
try:
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

8080
def _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

8485
for i in range(2): # Mimic Azure CLI's issue report

0 commit comments

Comments
 (0)