1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
import typing as t
import uuid
import pytest
import globus_sdk
from globus_sdk.testing import load_response
@pytest.mark.parametrize(
"transform",
(
pytest.param(lambda x: x, id="string"),
pytest.param(lambda x: [x], id="list"),
pytest.param(lambda x: {x}, id="set"),
pytest.param(lambda x: uuid.UUID(x), id="uuid"),
pytest.param(lambda x: [uuid.UUID(x)], id="uuid_list"),
),
)
def test_get_task_batch(
compute_client_v2: globus_sdk.ComputeClientV2, transform: t.Callable
):
meta = load_response(compute_client_v2.get_task_batch).metadata
task_ids = transform(meta["task_id"])
res = compute_client_v2.get_task_batch(task_ids=task_ids)
assert res.http_status == 200
assert meta["task_id"] in res.data["results"]
|