Debian Codegraph @

tests/functional/services/search/test_reopen_index.py

raw
1 import pytest
2
3 import globus_sdk
4 from globus_sdk.testing import load_response
5
6
7 def test_reopen_index(client):
8 meta = load_response(client.reopen_index).metadata
9
10 res = client.reopen_index(meta["index_id"])
11 assert res.http_status == 200
12 assert res["acknowledged"] is True
13
14
15 def test_reopen_index_already_open(client):
16 meta = load_response(client.reopen_index, case="already_open").metadata
17
18 with pytest.raises(globus_sdk.SearchAPIError) as excinfo:
19 client.reopen_index(meta["index_id"])
20
21 err = excinfo.value
22
23 assert err.http_status == 409
24 assert err.code == "Conflict.IncompatibleIndexStatus"