Skip to content

Commit bc1de09

Browse files
ashok672Copilot
andcommitted
Fix existing broker tests to pretend Apple Silicon
The new Intel-Mac gate reads platform.machine(). Existing tests patch sys.platform to darwin but ran on x86_64 CI runners, so the gate disabled the broker and four tests failed. Patch platform.machine() to arm64 so those Mac scenarios are hardware-independent. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 461a417 commit bc1de09

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/test_application.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,8 @@ def test_client_id_should_be_a_valid_scope(self):
10141014

10151015

10161016
@patch("sys.platform", new="darwin") # Pretend running on Mac.
1017+
@patch("msal.application.platform.machine", new=Mock(return_value="arm64"))
1018+
# Pretend Apple Silicon, because broker is not supported on Intel-based Macs.
10171019
@patch("msal.authority.tenant_discovery", new=Mock(return_value={
10181020
"authorization_endpoint": "https://contoso.com/placeholder",
10191021
"token_endpoint": "https://contoso.com/placeholder",
@@ -1056,6 +1058,8 @@ def test_should_fallback_when_pymsalruntime_failed_to_initialize_broker(self):
10561058

10571059

10581060
@patch("sys.platform", new="darwin") # Pretend running on Mac.
1061+
@patch("msal.application.platform.machine", new=Mock(return_value="arm64"))
1062+
# Pretend Apple Silicon, because broker is not supported on Intel-based Macs.
10591063
@patch("msal.authority.tenant_discovery", new=Mock(return_value={
10601064
"authorization_endpoint": "https://contoso.com/placeholder",
10611065
"token_endpoint": "https://contoso.com/placeholder",

0 commit comments

Comments
 (0)