| 1 |
import json |
| 2 |
|
| 3 |
from globus_sdk.testing import get_last_request, load_response |
| 4 |
|
| 5 |
|
| 6 |
def test_update_tunnel(client): |
| 7 |
meta = load_response(client.update_tunnel).metadata |
| 8 |
|
| 9 |
label = "New Name" |
| 10 |
update_doc = { |
| 11 |
"data": { |
| 12 |
"type": "Tunnel", |
| 13 |
"attributes": { |
| 14 |
"label": "New Name", |
| 15 |
}, |
| 16 |
} |
| 17 |
} |
| 18 |
res = client.update_tunnel(meta["tunnel_id"], update_doc) |
| 19 |
assert res.http_status == 200 |
| 20 |
assert res["data"]["type"] == "Tunnel" |
| 21 |
|
| 22 |
req = get_last_request() |
| 23 |
sent = json.loads(req.body) |
| 24 |
assert sent["data"]["attributes"]["label"] == label |