33import logging
44import sys
55
6- # from tests.test_e2e import LabBasedTestCase
7-
86if not sys .platform .startswith ("win" ):
97 raise unittest .SkipTest ("Currently, our broker supports Windows" )
108
1412 _AZURE_CLI ,
1513 authority = "https://login.microsoftonline.com/organizations" ,
1614 enable_broker_on_mac = True ,
17- enable_broker_on_windows = True )
18-
19-
20- # class ForceRefreshTestCase(LabBasedTestCase):
21- # def test_silent_with_force_refresh(self):
22- # # acquire token using username and password
23- # print("Testing silent flow with force_refresh=True")
24- # config = self.get_lab_user(usertype="cloud")
25- # config["password"] = self.get_lab_user_secret(config["lab_name"])
26- # result = pca.acquire_token_by_username_password(username=config["lab_name"], password=config["password"], scopes=config["scope"])
27- # # assert username and password, "You need to provide a test account and its password"
28-
29- # ropcToken = result.get("access_token")
30- # accounts = pca.get_accounts()
31- # account = accounts[0]
32- # assert account, "The logged in account should have been established by interactive flow"
33-
34- # result = pca.acquire_token_silent(
35- # config["scope"],
36- # account=account,
37- # force_refresh=False,
38- # auth_scheme=None, data=None)
39-
40- # assert result.get("access_token") == ropcToken, "Token should not be refreshed"
41-
15+ enable_broker_on_windows = True )
4216
4317class ForceRefreshTestCase (unittest .TestCase ):
4418 def test_silent_with_force_refresh (self ):
45- # acquire token using username and password
4619 print ("Testing silent flow with force_refresh=True" )
4720 result = pca .acquire_token_interactive (scopes = [SCOPE_ARM ], prompt = "select_account" , parent_window_handle = pca .CONSOLE_WINDOW_HANDLE , enable_msa_passthrough = True )
4821 accounts = pca .get_accounts ()
@@ -56,7 +29,7 @@ def test_silent_with_force_refresh(self):
5629 account = account ,
5730 force_refresh = False )
5831
59- # This token should be recieved from cache
32+ # This token should have been recieved from cache
6033 assert result .get ("access_token" ) == oldToken , "Token should not be refreshed"
6134
6235
@@ -65,5 +38,5 @@ def test_silent_with_force_refresh(self):
6538 account = account ,
6639 force_refresh = True )
6740
68- # Token will be different proving it is not from cache and was renewed
41+ # Token will be different proving it is not token from cache and was renewed
6942 assert result .get ("access_token" ) != oldToken , "Token should be refreshed"
0 commit comments