Debian Codegraph @

tests/functional/services/gcs/test_scope_helpers.py

raw
1 import uuid
2
3 zero_id = uuid.UUID(int=0)
4 zero_id_s = str(zero_id)
5
6
7 def test_manage_collections_scope_helper(client):
8 sc = client.get_gcs_endpoint_scopes(zero_id)
9 assert (
10 str(sc.manage_collections)
11 == f"urn:globus:auth:scope:{zero_id_s}:manage_collections"
12 )
13 # data_access is separated from endpoint scopes
14 assert not hasattr(sc, "data_access")
15
16
17 def test_data_access_scope_helper(client):
18 sc = client.get_gcs_collection_scopes(zero_id)
19 assert (
20 str(sc.data_access) == f"https://auth.globus.org/scopes/{zero_id_s}/data_access"
21 )
22 assert str(sc.https) == f"https://auth.globus.org/scopes/{zero_id_s}/https"
23 # manage_collections is separated from collection scopes
24 assert not hasattr(sc, "manage_collections")
25
26
27 def test_contains_scope_properties(client):
28 ep_sc = client.get_gcs_endpoint_scopes(zero_id)
29 assert ep_sc.manage_collections in list(ep_sc)
30
31 collection_sc = client.get_gcs_collection_scopes(zero_id)
32 assert collection_sc.data_access in list(collection_sc)