| 1 |
from globus_sdk.authorizers import AccessTokenAuthorizer |
| 2 |
from globus_sdk.testing import get_last_request, load_response |
| 3 |
|
| 4 |
|
| 5 |
def test_get_gcs_info(client): |
| 6 |
meta = load_response(client.get_gcs_info).metadata |
| 7 |
endpoint_client_id = meta["endpoint_client_id"] |
| 8 |
|
| 9 |
# set an authorizer |
| 10 |
client.authorizer = AccessTokenAuthorizer("access_token") |
| 11 |
|
| 12 |
res = client.get_gcs_info() |
| 13 |
assert res["endpoint_id"] == endpoint_client_id |
| 14 |
assert res["client_id"] == endpoint_client_id |
| 15 |
|
| 16 |
# confirm request was unauthenticated despite client having an authorizer |
| 17 |
req = get_last_request() |
| 18 |
assert "Authorization" not in req.headers |