Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug/BOUW-190: Fix path to health probe page #224

Merged
merged 2 commits into from
Apr 29, 2024
Merged
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 src/main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from django.urls import include, path

urlpatterns = [
path("iiif/status/health", include("health.urls")),
path("iiif/", include("iiif.urls")),
path("", include("health.urls")),
]
15 changes: 13 additions & 2 deletions tests/test_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@ def setUp(self):
self.http_client = Client()

def test_health_view(self):
response = self.http_client.get("/")
response = self.http_client.get("")
assert response.status_code == 200
assert response.content == b"Connectivity OK"

@mock.patch("health.views.settings.DEBUG", True)
def test_debug_false(self):
response = self.http_client.get("/")
response = self.http_client.get("")
assert response.status_code == 500
assert response.content == b"Debug mode not allowed in production"

def test_health_view_extra_path(self):
response = self.http_client.get("/iiif/status/health")
assert response.status_code == 200
assert response.content == b"Connectivity OK"

@mock.patch("health.views.settings.DEBUG", True)
def test_debug_false_extra_path(self):
response = self.http_client.get("/iiif/status/health")
assert response.status_code == 500
assert response.content == b"Debug mode not allowed in production"
Loading