File: test_operation_stat.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 (22 lines) | stat: -rw-r--r-- 603 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
"""
Tests for TransferClient.operation_stat
"""

import urllib.parse

from globus_sdk.testing import get_last_request, load_response


def test_operation_stat(client):
    meta = load_response(client.operation_stat).metadata
    endpoint_id = meta["endpoint_id"]
    path = "/home/share/godata/file1.txt"
    res = client.operation_stat(endpoint_id, path)

    assert res["name"] == "file1.txt"
    assert res["type"] == "file"
    assert res["size"] == 4

    req = get_last_request()
    parsed_qs = urllib.parse.parse_qs(urllib.parse.urlparse(req.url).query)
    assert parsed_qs == {"path": [path]}