@@ -401,7 +401,10 @@ def tearDownClass(cls):
401401 def get_lab_app_object (cls , ** query ): # https://msidlab.com/swagger/index.html
402402 url = "https://msidlab.com/api/app"
403403 resp = cls .session .get (url , params = query )
404- return resp .json ()[0 ]
404+ result = resp .json ()[0 ]
405+ result ["scopes" ] = [ # Raw data has extra space, such as "s1, s2"
406+ s .strip () for s in result ["defaultScopes" ].split (',' )]
407+ return result
405408
406409 @classmethod
407410 def get_lab_user_secret (cls , lab_name = "msidlab4" ):
@@ -698,7 +701,7 @@ def test_b2c_acquire_token_by_auth_code(self):
698701 authority = self ._build_b2c_authority ("B2C_1_SignInPolicy" ),
699702 client_id = config ["appId" ],
700703 port = 3843 , # Lab defines 4 of them: [3843, 4584, 4843, 60000]
701- scope = config ["defaultScopes" ]. split ( ',' ) ,
704+ scope = config ["scopes" ] ,
702705 )
703706
704707 @unittest .skipIf (os .getenv ("TRAVIS" ), "Browser automation is not yet implemented" )
@@ -708,7 +711,7 @@ def test_b2c_acquire_token_by_auth_code_flow(self):
708711 authority = self ._build_b2c_authority ("B2C_1_SignInPolicy" ),
709712 client_id = config ["appId" ],
710713 port = 3843 , # Lab defines 4 of them: [3843, 4584, 4843, 60000]
711- scope = config ["defaultScopes" ]. split ( ',' ) ,
714+ scope = config ["scopes" ] ,
712715 username_uri = "https://msidlab.com/api/user?usertype=b2c&b2cprovider=local" ,
713716 )
714717
@@ -719,7 +722,7 @@ def test_b2c_acquire_token_by_ropc(self):
719722 client_id = config ["appId" ],
720723721724 password = self .get_lab_user_secret ("msidlabb2c" ),
722- scope = config ["defaultScopes" ]. split ( ',' ) ,
725+ scope = config ["scopes" ] ,
723726 )
724727
725728
0 commit comments