File: test_get_gcs_info.py

package info (click to toggle)
python-globus-sdk 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,172 kB
  • sloc: python: 35,227; sh: 44; makefile: 35
file content (18 lines) | stat: -rw-r--r-- 636 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from globus_sdk.authorizers import AccessTokenAuthorizer
from globus_sdk.testing import get_last_request, load_response


def test_get_gcs_info(client):
    meta = load_response(client.get_gcs_info).metadata
    endpoint_client_id = meta["endpoint_client_id"]

    # set an authorizer
    client.authorizer = AccessTokenAuthorizer("access_token")

    res = client.get_gcs_info()
    assert res["endpoint_id"] == endpoint_client_id
    assert res["client_id"] == endpoint_client_id

    # confirm request was unauthenticated despite client having an authorizer
    req = get_last_request()
    assert "Authorization" not in req.headers