File: test_reopen_index.py

package info (click to toggle)
python-globus-sdk 4.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,144 kB
  • sloc: python: 35,242; sh: 37; makefile: 35
file content (24 lines) | stat: -rw-r--r-- 637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pytest

import globus_sdk
from globus_sdk.testing import load_response


def test_reopen_index(client):
    meta = load_response(client.reopen_index).metadata

    res = client.reopen_index(meta["index_id"])
    assert res.http_status == 200
    assert res["acknowledged"] is True


def test_reopen_index_already_open(client):
    meta = load_response(client.reopen_index, case="already_open").metadata

    with pytest.raises(globus_sdk.SearchAPIError) as excinfo:
        client.reopen_index(meta["index_id"])

    err = excinfo.value

    assert err.http_status == 409
    assert err.code == "Conflict.IncompatibleIndexStatus"