@@ -46,20 +46,19 @@ def test_device_flow_and_its_silent_call_should_bypass_broker(self, _, mocked_br
46
46
mocked_broker_ats .assert_not_called ()
47
47
self .assertEqual (result ["token_source" ], "identity_provider" )
48
48
49
- def test_ropc_flow_and_its_silent_call_should_bypass_broker (self , _ , mocked_broker_ats ):
49
+ def test_ropc_flow_and_its_silent_call_should_invoke_broker (self , _ , mocked_broker_ats ):
50
50
app = msal .PublicClientApplication ("client_id" , enable_broker_on_windows = True )
51
- with patch . object ( app . authority , "user_realm_discovery" , return_value = {} ):
51
+ with patch ( "msal.broker._signin_silently" , return_value = dict ( TOKEN_RESPONSE , _account_id = "placeholder" ) ):
52
52
result = app .acquire_token_by_username_password (
53
53
"username" , "placeholder" , [SCOPE ], post = _mock_post )
54
- self .assertEqual (result ["token_source" ], "identity_provider " )
54
+ self .assertEqual (result ["token_source" ], "broker " )
55
55
56
56
account = app .get_accounts ()[0 ]
57
- self .assertEqual (account ["account_source" ], "password " )
57
+ self .assertEqual (account ["account_source" ], "broker " )
58
58
59
59
result = app .acquire_token_silent_with_error (
60
60
[SCOPE ], account , force_refresh = True , post = _mock_post )
61
- mocked_broker_ats .assert_not_called ()
62
- self .assertEqual (result ["token_source" ], "identity_provider" )
61
+ self .assertEqual (result ["token_source" ], "broker" )
63
62
64
63
def test_interactive_flow_and_its_silent_call_should_invoke_broker (self , _ , mocked_broker_ats ):
65
64
app = msal .PublicClientApplication ("client_id" , enable_broker_on_windows = True )
0 commit comments