Skip to content

Commit

Permalink
Fix mocking of internal auth client
Browse files Browse the repository at this point in the history
  • Loading branch information
sirosen committed Dec 6, 2024
1 parent 4d434f7 commit 122235b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/functional/test_login_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def test_login_validates_token(
# undo the validate_token disabling patch which is done for most tests
disable_login_manager_validate_token.undo()

with mock.patch("globus_cli.login_manager.manager.internal_auth_client") as m:
with mock.patch(
"globus_cli.login_manager.tokenstore.CLITokenstorage.internal_auth_client"
) as m:
ac = mock.MagicMock(spec=globus_sdk.ConfidentialAppAuthClient)
m.return_value = ac

Expand Down Expand Up @@ -91,7 +93,8 @@ def test_login_gcs_different_identity(
)

monkeypatch.setattr(
"globus_cli.commands.logout.internal_native_client", lambda: mock_auth_client
"globus_cli.login_manager.tokenstore.CLITokenstorage.internal_auth_client",
mock_auth_client,
)
run_line("globus logout --yes")
assert manager.token_storage.read_well_known_config("auth_user_data") is None
Expand Down

0 comments on commit 122235b

Please sign in to comment.