| 1 |
import uuid |
| 2 |
|
| 3 |
from globus_sdk.testing.models import RegisteredResponse, ResponseSet |
| 4 |
|
| 5 |
INDEX_ID = str(uuid.uuid4()) |
| 6 |
|
| 7 |
|
| 8 |
RESPONSES = ResponseSet( |
| 9 |
default=RegisteredResponse( |
| 10 |
service="search", |
| 11 |
method="POST", |
| 12 |
path="/v1/index", |
| 13 |
json={ |
| 14 |
"@datatype": "GSearchIndex", |
| 15 |
"@version": "2017-09-01", |
| 16 |
"creation_date": "2021-04-05 15:05:18", |
| 17 |
"display_name": "Awesome Index of Awesomeness", |
| 18 |
"description": "An index so awesome that it simply cannot be described", |
| 19 |
"id": INDEX_ID, |
| 20 |
"is_trial": True, |
| 21 |
"subscription_id": None, |
| 22 |
"max_size_in_mb": 1, |
| 23 |
"num_entries": 0, |
| 24 |
"num_subjects": 0, |
| 25 |
"size_in_mb": 0, |
| 26 |
"status": "open", |
| 27 |
}, |
| 28 |
metadata={"index_id": INDEX_ID}, |
| 29 |
), |
| 30 |
trial_limit=RegisteredResponse( |
| 31 |
service="search", |
| 32 |
method="POST", |
| 33 |
path="/v1/index", |
| 34 |
status=409, |
| 35 |
json={ |
| 36 |
"@datatype": "GError", |
| 37 |
"request_id": "38186e960f3a64c9d530d48ba2271285", |
| 38 |
"status": 409, |
| 39 |
"error_data": { |
| 40 |
"cause": ( |
| 41 |
"When creating an index, an 'owner' role is created " |
| 42 |
"automatically. If this would exceed ownership limits, this error " |
| 43 |
"is raised instead." |
| 44 |
), |
| 45 |
"constraint": ( |
| 46 |
"Cannot create more ownership roles on trial indices " |
| 47 |
"than the limit (3)" |
| 48 |
), |
| 49 |
}, |
| 50 |
"@version": "2017-09-01", |
| 51 |
"message": "Role limit exceeded", |
| 52 |
"code": "Conflict.LimitExceeded", |
| 53 |
}, |
| 54 |
), |
| 55 |
) |