| 1 |
import copy |
| 2 |
|
| 3 |
from globus_sdk.testing import RegisteredResponse, ResponseSet |
| 4 |
|
| 5 |
from ._common import TWO_HOP_TRANSFER_RUN |
| 6 |
|
| 7 |
RUN_ID = TWO_HOP_TRANSFER_RUN["run_id"] |
| 8 |
|
| 9 |
SUCCESSFUL_DELETE_RESPONSE = copy.deepcopy(TWO_HOP_TRANSFER_RUN) |
| 10 |
SUCCESSFUL_DELETE_RESPONSE.update( |
| 11 |
{ |
| 12 |
"status": "SUCCEEDED", |
| 13 |
"display_status": "SUCCEEDED", |
| 14 |
"details": { |
| 15 |
"code": "FlowSucceeded", |
| 16 |
"output": {}, |
| 17 |
"description": "The Flow run reached a successful completion state", |
| 18 |
}, |
| 19 |
} |
| 20 |
) |
| 21 |
|
| 22 |
CONFLICT_RESPONSE = { |
| 23 |
"error": { |
| 24 |
"code": "STATE_CONFLICT", |
| 25 |
"detail": ( |
| 26 |
f"Run {RUN_ID} has status 'ACTIVE' but must have status" |
| 27 |
f" in {{'ENDED', 'SUCCEEDED', 'FAILED'}} for requested operation" |
| 28 |
), |
| 29 |
}, |
| 30 |
"debug_id": "80d920b6-66cf-4254-bcbd-7d3efe814e1a", |
| 31 |
} |
| 32 |
|
| 33 |
RESPONSES = ResponseSet( |
| 34 |
metadata={"run_id": RUN_ID}, |
| 35 |
default=RegisteredResponse( |
| 36 |
service="flows", |
| 37 |
method="POST", |
| 38 |
path=f"/runs/{RUN_ID}/release", |
| 39 |
json=SUCCESSFUL_DELETE_RESPONSE, |
| 40 |
), |
| 41 |
conflict=RegisteredResponse( |
| 42 |
service="flows", |
| 43 |
method="POST", |
| 44 |
path=f"/runs/{RUN_ID}/release", |
| 45 |
status=409, |
| 46 |
json=CONFLICT_RESPONSE, |
| 47 |
), |
| 48 |
) |