File: test_update_tunnel.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 (24 lines) | stat: -rw-r--r-- 610 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
23
24
import json

from globus_sdk.testing import get_last_request, load_response


def test_update_tunnel(client):
    meta = load_response(client.update_tunnel).metadata

    label = "New Name"
    update_doc = {
        "data": {
            "type": "Tunnel",
            "attributes": {
                "label": "New Name",
            },
        }
    }
    res = client.update_tunnel(meta["tunnel_id"], update_doc)
    assert res.http_status == 200
    assert res["data"]["type"] == "Tunnel"

    req = get_last_request()
    sent = json.loads(req.body)
    assert sent["data"]["attributes"]["label"] == label