-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the
FlowsClient.get_run()
include_flow_description
parameter
- Loading branch information
Showing
4 changed files
with
40 additions
and
20 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...d/20230706_111957_kurtmckee_fix_include_flow_description_parameter_sc_25534.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Fixed | ||
~~~~~ | ||
|
||
- Adjust the ``FlowsClient.get_run()`` ``include_flow_description`` parameter | ||
so it is sent as a lowercase string (``true`` or ``false``). (:pr:`NUMBER`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
from globus_sdk._testing import load_response | ||
import pytest | ||
|
||
from globus_sdk._testing import get_last_request, load_response | ||
|
||
def test_get_run(flows_client): | ||
metadata = load_response(flows_client.get_run).metadata | ||
|
||
resp = flows_client.get_run(metadata["run_id"]) | ||
assert resp.http_status == 200 | ||
assert "flow_description" not in resp | ||
|
||
|
||
def test_get_run_with_flow_description(flows_client): | ||
@pytest.mark.parametrize("include_flow_description", (None, False, True)) | ||
def test_get_run(flows_client, include_flow_description): | ||
metadata = load_response(flows_client.get_run).metadata | ||
|
||
resp = flows_client.get_run(metadata["run_id"], include_flow_description=True) | ||
assert resp.http_status == 200 | ||
assert "flow_description" in resp | ||
response = flows_client.get_run( | ||
metadata["run_id"], | ||
include_flow_description=include_flow_description, | ||
) | ||
assert response.http_status == 200 | ||
|
||
request = get_last_request() | ||
if include_flow_description is None: | ||
assert "flow_description" not in response | ||
assert "include_flow_description" not in request.url | ||
elif include_flow_description is False: | ||
assert "flow_description" not in response | ||
assert "include_flow_description=false" in request.url | ||
else: # include_flow_description is True | ||
assert "flow_description" in response | ||
assert "include_flow_description=true" in request.url |