| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
import uuid |
| 4 |
|
| 5 |
import pytest |
| 6 |
|
| 7 |
from globus_sdk import GlobusSDKUsageError |
| 8 |
from globus_sdk.testing import load_response |
| 9 |
|
| 10 |
|
| 11 |
@pytest.mark.parametrize( |
| 12 |
"case_name", |
| 13 |
( |
| 14 |
"name", |
| 15 |
"publicly_visible", |
| 16 |
"not_publicly_visible", |
| 17 |
"redirect_uris", |
| 18 |
"links", |
| 19 |
"required_idp", |
| 20 |
"preselect_idp", |
| 21 |
), |
| 22 |
) |
| 23 |
def test_update_client_args( |
| 24 |
service_client, |
| 25 |
case_name: str, |
| 26 |
): |
| 27 |
meta = load_response(service_client.update_client, case=case_name).metadata |
| 28 |
|
| 29 |
res = service_client.update_client(**meta["args"]) |
| 30 |
for k, v in meta["response"].items(): |
| 31 |
assert res["client"][k] == v |
| 32 |
|
| 33 |
|
| 34 |
def test_links_requirement(service_client): |
| 35 |
""" |
| 36 |
Verify that terms_and_conditions and privacy_policy must be used together. |
| 37 |
""" |
| 38 |
with pytest.raises(GlobusSDKUsageError): |
| 39 |
service_client.create_client( |
| 40 |
"FOO", |
| 41 |
uuid.uuid1(), |
| 42 |
visibility="public", |
| 43 |
terms_and_conditions="https://foo.net", |
| 44 |
) |
| 45 |
|
| 46 |
with pytest.raises(GlobusSDKUsageError): |
| 47 |
service_client.create_client( |
| 48 |
"FOO", |
| 49 |
uuid.uuid1(), |
| 50 |
visibility="public", |
| 51 |
privacy_policy="https://foo.net", |
| 52 |
) |