| 1 |
import uuid |
| 2 |
|
| 3 |
from globus_sdk.testing.models import RegisteredResponse, ResponseSet |
| 4 |
|
| 5 |
project_id = str(uuid.uuid1()) |
| 6 |
star_lord = { |
| 7 |
"identity_provider": str(uuid.uuid1()), |
| 8 |
"identity_type": "login", |
| 9 |
"organization": "Guardians of the Galaxy", |
| 10 |
"status": "used", |
| 11 |
"id": str(uuid.uuid1()), |
| 12 |
"name": "Star Lord", |
| 13 |
"username": "[email protected]", |
| 14 |
"email": "[email protected]", |
| 15 |
} |
| 16 |
guardians_group = { |
| 17 |
"id": str(uuid.uuid1()), |
| 18 |
"name": "Guardians of the Galaxy", |
| 19 |
"description": "A group of heroes", |
| 20 |
"organization": "Guardians of the Galaxy", |
| 21 |
} |
| 22 |
|
| 23 |
|
| 24 |
RESPONSES = ResponseSet( |
| 25 |
default=RegisteredResponse( |
| 26 |
service="auth", |
| 27 |
path=f"/v2/api/projects/{project_id}", |
| 28 |
method="PUT", |
| 29 |
json={ |
| 30 |
"project": { |
| 31 |
"contact_email": "[email protected]", |
| 32 |
"id": project_id, |
| 33 |
"admins": { |
| 34 |
"identities": [star_lord], |
| 35 |
"groups": [], |
| 36 |
}, |
| 37 |
"project_name": "Guardians of the Galaxy", |
| 38 |
"admin_ids": [star_lord["id"]], |
| 39 |
"admin_group_ids": None, |
| 40 |
"display_name": "Guardians of the Galaxy", |
| 41 |
} |
| 42 |
}, |
| 43 |
metadata={ |
| 44 |
"id": project_id, |
| 45 |
"admin_id": star_lord["id"], |
| 46 |
}, |
| 47 |
), |
| 48 |
admin_group=RegisteredResponse( |
| 49 |
service="auth", |
| 50 |
path=f"/v2/api/projects/{project_id}", |
| 51 |
method="PUT", |
| 52 |
json={ |
| 53 |
"project": { |
| 54 |
"contact_email": "[email protected]", |
| 55 |
"id": project_id, |
| 56 |
"admins": { |
| 57 |
"identities": [], |
| 58 |
"groups": [guardians_group], |
| 59 |
}, |
| 60 |
"project_name": "Guardians of the Galaxy", |
| 61 |
"admin_ids": None, |
| 62 |
"admin_group_ids": [guardians_group["id"]], |
| 63 |
"display_name": "Guardians of the Galaxy", |
| 64 |
} |
| 65 |
}, |
| 66 |
metadata={ |
| 67 |
"id": project_id, |
| 68 |
"admin_group_id": guardians_group["id"], |
| 69 |
}, |
| 70 |
), |
| 71 |
) |