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