Skip to content

Commit

Permalink
Merge pull request #17 from PADAS/gundi-3129-webhook-config
Browse files Browse the repository at this point in the history
GUNDI-3129: Support webhook configurations
  • Loading branch information
marianobrc authored Jun 5, 2024
2 parents 910d35a + 27d478b commit 8768f11
Show file tree
Hide file tree
Showing 4 changed files with 309 additions and 63 deletions.
122 changes: 61 additions & 61 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gundi-client-v2"
version = "2.2.0"
version = "2.3.0"
description = "An async client for Gundi's API"
authors = [
"Chris Doehring <chrisdo@earthranger.com>",
Expand All @@ -20,7 +20,7 @@ environs = "^9.5"
pydantic = "^1.10"
httpx = "^0.24.0"
respx = "^0.20.1"
gundi-core = "^1.2.1"
gundi-core = "^1.4.0"

[tool.poetry.group.dev.dependencies]
black = "^23.1.0"
Expand Down
24 changes: 24 additions & 0 deletions tests/client/test_integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,27 @@ async def test_get_destination_integration_details(
assert isinstance(integration, Integration)
assert integration == Integration.parse_obj(destination_integration_details)


@pytest.mark.asyncio
async def test_get_webhook_integration_details(
auth_token_response, webhook_integration_details, gundi_client_v2
):
async with respx.mock(assert_all_called=False) as gundi_portal_mock:
# Mock authentication
gundi_portal_mock.post(gundi_client_v2.oauth_token_url).respond(
status_code=httpx.codes.CREATED,
json=auth_token_response
)
# Mock configuration
integration_id = "817d3d4e-5dba-4792-8a30-a87603c5d201"
integration_details_url = f"{gundi_client_v2.integrations_endpoint}/{integration_id}/"
gundi_portal_mock.get(integration_details_url).respond(
status_code=httpx.codes.OK,
json=webhook_integration_details
)
integration = await gundi_client_v2.get_integration_details(
integration_id=integration_id
)
assert isinstance(integration, Integration)
assert integration == Integration.parse_obj(webhook_integration_details)

Loading

0 comments on commit 8768f11

Please sign in to comment.