| 1 |
""" |
| 2 |
Tests for TransferClient.operation_stat |
| 3 |
""" |
| 4 |
|
| 5 |
import urllib.parse |
| 6 |
|
| 7 |
from globus_sdk.testing import get_last_request, load_response |
| 8 |
|
| 9 |
|
| 10 |
def test_operation_stat(client): |
| 11 |
meta = load_response(client.operation_stat).metadata |
| 12 |
endpoint_id = meta["endpoint_id"] |
| 13 |
path = "/home/share/godata/file1.txt" |
| 14 |
res = client.operation_stat(endpoint_id, path) |
| 15 |
|
| 16 |
assert res["name"] == "file1.txt" |
| 17 |
assert res["type"] == "file" |
| 18 |
assert res["size"] == 4 |
| 19 |
|
| 20 |
req = get_last_request() |
| 21 |
parsed_qs = urllib.parse.parse_qs(urllib.parse.urlparse(req.url).query) |
| 22 |
assert parsed_qs == {"path": [path]} |