Skip to content

Commit

Permalink
Rebase from main
Browse files Browse the repository at this point in the history
  • Loading branch information
derek-globus committed Jun 30, 2024
1 parent 62a02ac commit 045f8a4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/unit/test_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
import globus_sdk
from globus_sdk._testing import RegisteredResponse, get_last_request
from globus_sdk.authorizers import NullAuthorizer
from globus_sdk.experimental.globus_app import UserApp
from globus_sdk.experimental.globus_app.errors import MissingTokensError
from globus_sdk.experimental.globus_app import GlobusApp, GlobusAppConfig, UserApp
from globus_sdk.experimental.globus_app.errors import (
MissingTokenError,
TokenValidationError,
)
from globus_sdk.scopes import Scope, TransferScopes


Expand Down Expand Up @@ -211,7 +214,12 @@ def test_base_path_matching_prefix(


def test_app_integration(base_client_class):
app = UserApp("SDK Test", client_id="client_id")
def _reraise_token_error(_: GlobusApp, error: TokenValidationError):
raise error

config = GlobusAppConfig(token_validation_error_handler=_reraise_token_error)
app = UserApp("SDK Test", client_id="client_id", config=config)

c = base_client_class(app=app)

# confirm app_name set
Expand All @@ -226,7 +234,7 @@ def test_app_integration(base_client_class):
RegisteredResponse(
service="transfer", path="foo", method="get", json={"x": "y"}
).add()
with pytest.raises(MissingTokensError) as ex:
with pytest.raises(MissingTokenError) as ex:
c.get("foo")
assert str(ex.value) == "No token data for transfer.api.globus.org"

Expand Down

0 comments on commit 045f8a4

Please sign in to comment.