| 1 |
import pytest |
| 2 |
|
| 3 |
from globus_sdk import MISSING |
| 4 |
from globus_sdk.testing import get_last_request, load_response |
| 5 |
|
| 6 |
|
| 7 |
@pytest.mark.parametrize("include_flow_description", (MISSING, False, True)) |
| 8 |
def test_get_run(flows_client, include_flow_description): |
| 9 |
metadata = load_response(flows_client.get_run).metadata |
| 10 |
|
| 11 |
response = flows_client.get_run( |
| 12 |
metadata["run_id"], |
| 13 |
include_flow_description=include_flow_description, |
| 14 |
) |
| 15 |
assert response.http_status == 200 |
| 16 |
|
| 17 |
request = get_last_request() |
| 18 |
if include_flow_description is MISSING: |
| 19 |
assert "flow_description" not in response |
| 20 |
assert "include_flow_description" not in request.url |
| 21 |
elif include_flow_description is False: |
| 22 |
assert "flow_description" not in response |
| 23 |
assert "include_flow_description=False" in request.url |
| 24 |
else: # include_flow_description is True |
| 25 |
assert "flow_description" in response |
| 26 |
assert "include_flow_description=True" in request.url |