File: test_get_my_groups.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 (19 lines) | stat: -rw-r--r-- 624 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import urllib.parse

from globus_sdk.response import ArrayResponse
from globus_sdk.testing import get_last_request, load_response


def test_get_my_groups(groups_client):
    meta = load_response(groups_client.get_my_groups).metadata

    res = groups_client.get_my_groups(statuses="active")
    assert res.http_status == 200

    req = get_last_request()
    parsed_qs = urllib.parse.parse_qs(urllib.parse.urlparse(req.url).query)
    assert parsed_qs["statuses"] == ["active"]

    assert isinstance(res, ArrayResponse)
    assert isinstance(res.data, list)
    assert set(meta["group_names"]) == {g["name"] for g in res}