| 1 |
from copy import deepcopy |
| 2 |
|
| 3 |
from responses.matchers import query_param_matcher |
| 4 |
|
| 5 |
from globus_sdk.testing import RegisteredResponse, ResponseList, ResponseSet |
| 6 |
|
| 7 |
from ._common import FLOW_DESCRIPTION, RUN, RUN_ID |
| 8 |
|
| 9 |
RUN_WITH_FLOW_DESCRIPTION = deepcopy(RUN) |
| 10 |
RUN_WITH_FLOW_DESCRIPTION["flow_description"] = FLOW_DESCRIPTION |
| 11 |
|
| 12 |
RESPONSES = ResponseSet( |
| 13 |
metadata={"run_id": RUN_ID}, |
| 14 |
default=ResponseList( |
| 15 |
RegisteredResponse( |
| 16 |
service="flows", |
| 17 |
method="GET", |
| 18 |
path=f"/runs/{RUN_ID}", |
| 19 |
json=RUN, |
| 20 |
match=[query_param_matcher(params={})], |
| 21 |
), |
| 22 |
RegisteredResponse( |
| 23 |
service="flows", |
| 24 |
method="GET", |
| 25 |
path=f"/runs/{RUN_ID}", |
| 26 |
json=RUN, |
| 27 |
match=[query_param_matcher(params={"include_flow_description": "False"})], |
| 28 |
), |
| 29 |
RegisteredResponse( |
| 30 |
service="flows", |
| 31 |
method="GET", |
| 32 |
path=f"/runs/{RUN_ID}", |
| 33 |
json=RUN_WITH_FLOW_DESCRIPTION, |
| 34 |
match=[query_param_matcher(params={"include_flow_description": "True"})], |
| 35 |
), |
| 36 |
), |
| 37 |
) |