| 1 |
from globus_sdk.testing.models import RegisteredResponse, ResponseSet |
| 2 |
|
| 3 |
from ._common import TIMER_ID, V1_TIMER |
| 4 |
|
| 5 |
TIMER_INACTIVE_USER = { |
| 6 |
**V1_TIMER, |
| 7 |
"status": "inactive", |
| 8 |
"inactive_reason": {"cause": "user", "detail": None}, |
| 9 |
} |
| 10 |
|
| 11 |
TIMER_INACTIVE_GARE = { |
| 12 |
**V1_TIMER, |
| 13 |
"status": "inactive", |
| 14 |
"inactive_reason": { |
| 15 |
"cause": "globus_auth_requirements", |
| 16 |
"detail": { |
| 17 |
"code": "ConsentRequired", |
| 18 |
"authorization_parameters": { |
| 19 |
"session_message": "Missing required data_access consent", |
| 20 |
"required_scopes": [ |
| 21 |
( |
| 22 |
"https://auth.globus.org/scopes/actions.globus.org/" |
| 23 |
"transfer/transfer" |
| 24 |
"[urn:globus:auth:scope:transfer.api.globus.org:all" |
| 25 |
"[*https://auth.globus.org/scopes/" |
| 26 |
"543aade1-db97-4a4b-9bdf-0b58e78dfa69/data_access]]" |
| 27 |
) |
| 28 |
], |
| 29 |
}, |
| 30 |
}, |
| 31 |
}, |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
RESPONSES = ResponseSet( |
| 36 |
metadata={"job_id": TIMER_ID}, |
| 37 |
default=RegisteredResponse( |
| 38 |
service="timer", |
| 39 |
path=f"/jobs/{TIMER_ID}", |
| 40 |
method="GET", |
| 41 |
json=V1_TIMER, |
| 42 |
), |
| 43 |
inactive_gare=RegisteredResponse( |
| 44 |
service="timer", |
| 45 |
path=f"/jobs/{TIMER_ID}", |
| 46 |
method="GET", |
| 47 |
json=TIMER_INACTIVE_GARE, |
| 48 |
), |
| 49 |
inactive_user=RegisteredResponse( |
| 50 |
service="timer", |
| 51 |
path=f"/jobs/{TIMER_ID}", |
| 52 |
method="GET", |
| 53 |
json=TIMER_INACTIVE_USER, |
| 54 |
), |
| 55 |
simple_500_error=RegisteredResponse( |
| 56 |
service="timer", |
| 57 |
path=f"/jobs/{TIMER_ID}", |
| 58 |
method="GET", |
| 59 |
status=500, |
| 60 |
json={ |
| 61 |
"error": { |
| 62 |
"code": "ERROR", |
| 63 |
"detail": "Request failed terribly", |
| 64 |
"status": 500, |
| 65 |
} |
| 66 |
}, |
| 67 |
), |
| 68 |
) |