Skip to content

Commit

Permalink
Get Checkpoint after it's been created
Browse files Browse the repository at this point in the history
  • Loading branch information
josectobar committed Oct 28, 2023
1 parent e922195 commit 22d293b
Showing 1 changed file with 33 additions and 13 deletions.
46 changes: 33 additions & 13 deletions tests/integration/cloud/rest_contracts/test_add_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from tests.integration.cloud.rest_contracts.conftest import PactBody

NON_EXISTING_CHECKPOINT_ID: Final[str] = "68058949-f9c2-47b1-922a-a89c23ffad99"
EXISTING_CHECKPOINT_ID: Final[str] = "68058949-f9c2-47b1-922a-a89c23ffad99"
PUT_CHECKPOINT_MIN_RESPONSE_BODY: Final[PactBody] = pact.Like("204 string")
PUT_CHECKPOINTS_MIN_REQUEST_BODY = {
"data":
Expand All @@ -28,24 +29,29 @@

}

GET_CHECKPOINTS_MIN_RESPONSE_BODY: Final[dict] = {
"data":
{
"id": pact.Format().uuid,
"type": "checkpoint",
"attributes": {
"checkpoint_config": {
"validations": [
{
"id": pact.Format().uuid,
}
]
},
},
},

}


@pytest.mark.cloud
@pytest.mark.parametrize(
"contract_interaction",
[
# ContractInteraction(
# method="POST",
# request_path=pathlib.Path(
# "/",
# "organizations",
# EXISTING_ORGANIZATION_ID,
# "datasources",
# ),
# upon_receiving="a request to add a Data Source",
# given="the Data Source does not exist",
# response_status=200,
# response_body=POST_DATASOURCE_MIN_RESPONSE_BODY,
# ),
ContractInteraction(
method="PUT",
request_path=pathlib.Path(
Expand All @@ -61,6 +67,20 @@
response_status=204,
response_body="",
),
ContractInteraction(
method="GET",
request_path=pathlib.Path(
"/",
"organizations",
EXISTING_ORGANIZATION_ID,
"checkpoints",
EXISTING_CHECKPOINT_ID,
),
upon_receiving="a request to get a Checkpoint",
given="the Checkpoint exists",
response_status=200,
response_body=GET_CHECKPOINTS_MIN_RESPONSE_BODY,
),
],
)
def test_put_checkpoint(
Expand Down

0 comments on commit 22d293b

Please sign in to comment.