Skip to content

Commit

Permalink
Fix missing f-string in EP manager method + test (#683)
Browse files Browse the repository at this point in the history
`TransferClient.endpoint_manager_task_successful_transfers` was not
making calls correctly.

Setup fixture data for a response, add a relevant test, and add the
missing `f` prefix.

resolves #682
  • Loading branch information
sirosen authored Feb 14, 2023
1 parent 323a9c0 commit 89e7be5
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
2 changes: 2 additions & 0 deletions changelog.d/20230214_193302_sirosen_fix_missing_fstring.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Fix a typo in ``TransferClient.endpoint_manager_task_successful_transfers``
which prevented calls from being made correctly (:pr:`NUMBER`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from globus_sdk._testing.models import RegisteredResponse, ResponseSet

from ._common import TASK_ID

RESPONSES = ResponseSet(
metadata={"task_id": TASK_ID},
default=RegisteredResponse(
service="transfer",
method="GET",
path=f"/endpoint_manager/task/{TASK_ID}/successful_transfers",
json={
"DATA_TYPE": "successful_transfers",
"marker": 0,
"next_marker": 93979,
"DATA": [
{
"destination_path": "/path/to/destination",
"source_path": "/path/to/source",
"DATA_TYPE": "successful_transfer",
}
],
},
),
)
2 changes: 1 addition & 1 deletion src/globus_sdk/services/transfer/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,7 @@ def endpoint_manager_task_successful_transfers(
query_params["marker"] = marker
return IterableTransferResponse(
self.get(
"endpoint_manager/task/{task_id}/successful_transfers",
f"endpoint_manager/task/{task_id}/successful_transfers",
query_params=query_params,
)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import pytest
from globus_sdk._testing import load_response


@pytest.mark.xfail
def test_endpoint_manager_task_successful_transfers():
raise NotImplementedError
def test_endpoint_manager_task_successful_transfers(client):
meta = load_response(client.endpoint_manager_task_successful_transfers).metadata

response = client.endpoint_manager_task_successful_transfers(meta["task_id"])

assert response.http_status == 200
assert response["DATA_TYPE"] == "successful_transfers"

0 comments on commit 89e7be5

Please sign in to comment.