@@ -46,20 +46,19 @@ def test_device_flow_and_its_silent_call_should_bypass_broker(self, _, mocked_br
4646 mocked_broker_ats .assert_not_called ()
4747 self .assertEqual (result ["token_source" ], "identity_provider" )
4848
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 ):
5050 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" ) ):
5252 result = app .acquire_token_by_username_password (
5353 "username" , "placeholder" , [SCOPE ], post = _mock_post )
54- self .assertEqual (result ["token_source" ], "identity_provider " )
54+ self .assertEqual (result ["token_source" ], "broker " )
5555
5656 account = app .get_accounts ()[0 ]
57- self .assertEqual (account ["account_source" ], "password " )
57+ self .assertEqual (account ["account_source" ], "broker " )
5858
5959 result = app .acquire_token_silent_with_error (
6060 [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" )
6362
6463 def test_interactive_flow_and_its_silent_call_should_invoke_broker (self , _ , mocked_broker_ats ):
6564 app = msal .PublicClientApplication ("client_id" , enable_broker_on_windows = True )
0 commit comments