| 1 |
import pytest |
| 2 |
|
| 3 |
import globus_sdk |
| 4 |
from globus_sdk.testing import load_response |
| 5 |
|
| 6 |
|
| 7 |
# TODO: add data for the success case and test it |
| 8 |
@pytest.mark.xfail |
| 9 |
def test_userinfo(): |
| 10 |
raise NotImplementedError |
| 11 |
|
| 12 |
|
| 13 |
@pytest.mark.parametrize("casename", ("unauthorized", "forbidden")) |
| 14 |
def test_userinfo_error_handling(service_client, casename): |
| 15 |
meta = load_response(service_client.userinfo, case=casename).metadata |
| 16 |
|
| 17 |
with pytest.raises(globus_sdk.AuthAPIError) as excinfo: |
| 18 |
service_client.userinfo() |
| 19 |
|
| 20 |
err = excinfo.value |
| 21 |
assert err.http_status == meta["http_status"] |
| 22 |
assert err.code == meta["code"] |
| 23 |
assert err.request_id == meta["error_id"] |