File: test_get_task_batch.py

package info (click to toggle)
python-globus-sdk 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,172 kB
  • sloc: python: 35,227; sh: 44; makefile: 35
file content (28 lines) | stat: -rw-r--r-- 792 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
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"]