Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions airbyte_cdk/manifest_server/routers/capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
)


@router.get("", include_in_schema=False)
@router.get("/", operation_id="getCapabilities")
def get_capabilities() -> CapabilitiesResponse:
"""
Expand Down
1 change: 1 addition & 0 deletions airbyte_cdk/manifest_server/routers/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)


@router.get("", include_in_schema=False)
@router.get("/")
def health() -> Dict[str, str]:
return {"status": "ok"}
7 changes: 6 additions & 1 deletion unit_tests/manifest_server/routers/test_capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from airbyte_cdk.manifest_server.app import app

client = TestClient(app)
client = TestClient(app, follow_redirects=False)


class TestCapabilities:
Expand All @@ -16,6 +16,11 @@ def test_capabilities_endpoint_exists(self):
response = client.get("/capabilities/")
assert response.status_code == 200

def test_capabilities_endpoint_without_trailing_slash(self):
"""Test that the capabilities endpoint does not redirect without a trailing slash."""
response = client.get("/capabilities")
assert response.status_code == 200

def test_capabilities_custom_code_execution_false_by_default(self):
"""Test that custom_code_execution is false by default when env var is not set."""
with patch.dict(os.environ, {}, clear=True):
Expand Down
18 changes: 18 additions & 0 deletions unit_tests/manifest_server/routers/test_health.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from fastapi.testclient import TestClient

from airbyte_cdk.manifest_server.app import app

client = TestClient(app, follow_redirects=False)


def test_health_endpoint_without_trailing_slash() -> None:
response = client.get("/health")

assert response.status_code == 200
assert response.json() == {"status": "ok"}


def test_health_endpoint_with_trailing_slash() -> None:
response = client.get("/health/")

assert response.status_code == 200
Loading