File: test_get_group_by_subscription_id.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 (27 lines) | stat: -rw-r--r-- 1,002 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
25
26
27
from globus_sdk.testing import load_response


def test_get_group_by_subscription_id(groups_client):
    meta = load_response(groups_client.get_group_by_subscription_id).metadata

    res = groups_client.get_group_by_subscription_id(meta["subscription_id"])
    assert res.http_status == 200
    assert res["group_id"] == meta["group_id"]
    assert "description" not in res
    assert "name" not in res


def test_two_step_get_group_by_subscription_id(groups_client):
    meta = load_response(groups_client.get_group_by_subscription_id).metadata
    load_response(groups_client.get_group, case="subscription").metadata

    res = groups_client.get_group_by_subscription_id(meta["subscription_id"])
    assert res.http_status == 200
    assert res["group_id"] == meta["group_id"]
    assert "description" not in res
    assert "name" not in res

    res2 = groups_client.get_group(meta["group_id"])
    assert res2.http_status == 200
    assert res2["id"] == meta["group_id"]
    assert "name" in res2