| 1 |
import uuid |
| 2 |
|
| 3 |
from globus_sdk.testing.models import RegisteredResponse, ResponseSet |
| 4 |
|
| 5 |
from ._common import ENDPOINT_ID, SUBSCRIPTION_ID |
| 6 |
|
| 7 |
OTHER_SUBSCRIPTION_ID = str(uuid.UUID(int=10)) |
| 8 |
|
| 9 |
RESPONSES = ResponseSet( |
| 10 |
metadata={"endpoint_id": ENDPOINT_ID}, |
| 11 |
default=RegisteredResponse( |
| 12 |
service="transfer", |
| 13 |
method="PUT", |
| 14 |
path=f"/v0.10/endpoint/{ENDPOINT_ID}/subscription", |
| 15 |
json={ |
| 16 |
"DATA_TYPE": "result", |
| 17 |
"code": "Updated", |
| 18 |
"message": "Endpoint updated successfully", |
| 19 |
"request_id": "dWTZZe17L", |
| 20 |
"resource": f"/v0.10/endpoint/{ENDPOINT_ID}/subscription", |
| 21 |
}, |
| 22 |
), |
| 23 |
not_found=RegisteredResponse( |
| 24 |
service="transfer", |
| 25 |
method="PUT", |
| 26 |
path=f"/v0.10/endpoint/{ENDPOINT_ID}/subscription", |
| 27 |
status=404, |
| 28 |
json={ |
| 29 |
"code": "EndpointNotFound", |
| 30 |
"message": f"No such endpoint '{ENDPOINT_ID}'", |
| 31 |
"request_id": "BHI2BHt8N", |
| 32 |
"resource": f"/v0.10/endpoint/{ENDPOINT_ID}/subscription", |
| 33 |
}, |
| 34 |
), |
| 35 |
multi_subscriber_cannot_use_default=RegisteredResponse( |
| 36 |
service="transfer", |
| 37 |
method="PUT", |
| 38 |
path=f"/v0.10/endpoint/{ENDPOINT_ID}/subscription", |
| 39 |
status=400, |
| 40 |
json={ |
| 41 |
"code": "BadRequest", |
| 42 |
"message": ( |
| 43 |
"Please specify the subscription ID to use. " |
| 44 |
"You currently have access to: " |
| 45 |
f"{SUBSCRIPTION_ID}, {OTHER_SUBSCRIPTION_ID}" |
| 46 |
), |
| 47 |
"request_id": "H1dFNg6QB", |
| 48 |
"resource": f"/v0.10/endpoint/{ENDPOINT_ID}/subscription", |
| 49 |
}, |
| 50 |
metadata={ |
| 51 |
"endpoint_id": ENDPOINT_ID, |
| 52 |
"subscription_ids": [SUBSCRIPTION_ID, OTHER_SUBSCRIPTION_ID], |
| 53 |
}, |
| 54 |
), |
| 55 |
) |