File: test_get_consents.py

package info (click to toggle)
python-globus-sdk 4.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,180 kB
  • sloc: python: 35,340; sh: 37; makefile: 35
file content (16 lines) | stat: -rw-r--r-- 617 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from globus_sdk.testing import load_response


def test_get_consents(service_client):
    meta = load_response(service_client.get_consents).metadata
    res = service_client.get_consents(meta["identity_id"])

    forest = res.to_forest()
    assert len(forest.nodes) == 2
    assert len(forest.trees) == 1
    tree = forest.trees[0]
    assert forest.trees[0].max_depth == 2
    assert tree.root.scope_name.endswith("transfer.api.globus.org:all")
    children = [tree.get_node(child_id) for child_id in tree.edges[tree.root.id]]
    assert len(children) == 1
    assert children[0].scope_name.endswith("data_access")