Skip to content

Commit 882e41d

Browse files
committed
update
1 parent 46bb0c4 commit 882e41d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/broker-test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
we can use this script to test it with a given version of MSAL Python.
77
"""
88
import msal
9+
import getpass
910
import os
1011
try:
1112
from dotenv import load_dotenv # Use this only in local dev machine
@@ -54,10 +55,9 @@ def interactive_and_silent(scopes, auth_scheme, data, expected_token_type):
5455

5556
def test_broker_username_password(scopes, expected_token_type):
5657
print("Testing broker username password flows by using accounts in local .env")
57-
username = os.getenv("ENV_LAB4_ACCOUNT")
58-
password = os.getenv("ENV_LAB4_ACCOUNT_PASSWORD")
59-
assert(username!=None and len(username)>0)
60-
assert(password!=None and len(password)>0)
58+
username = os.getenv("BROKER_TEST_ACCOUNT") or input("Input test account for broker test: ")
59+
password = os.getenv("BROKER_TEST_ACCOUNT_PASSWORD") or getpass.getpass("Input test account's password: ")
60+
assert(username and password, "You need to provide a test account and its password")
6161
result = pca.acquire_token_by_username_password(username, password, scopes)
6262
_assert(result, expected_token_type)
6363
assert(result.get("token_source") == "broker")

0 commit comments

Comments
 (0)