| 1 |
import pytest |
| 2 |
|
| 3 |
import globus_sdk |
| 4 |
from globus_sdk.testing import load_response |
| 5 |
|
| 6 |
|
| 7 |
def test_update_index(client): |
| 8 |
meta = load_response(client.update_index).metadata |
| 9 |
|
| 10 |
res = client.update_index(meta["index_id"], display_name="foo") |
| 11 |
assert res.http_status == 200 |
| 12 |
assert res["display_name"] == meta["display_name"] |
| 13 |
|
| 14 |
|
| 15 |
def test_update_index_forbidden_error(client): |
| 16 |
meta = load_response(client.update_index, case="forbidden").metadata |
| 17 |
|
| 18 |
with pytest.raises(globus_sdk.SearchAPIError) as excinfo: |
| 19 |
client.update_index(meta["index_id"]) |
| 20 |
|
| 21 |
err = excinfo.value |
| 22 |
|
| 23 |
assert err.http_status == 403 |
| 24 |
assert err.code == "Forbidden.Generic" |