From c93f6b3fc34ee561cdb8fb937d708f43112bfa03 Mon Sep 17 00:00:00 2001 From: Felix Zumstein Date: Sun, 8 Dec 2024 23:17:56 +0100 Subject: [PATCH] Fix attempt 2 for empty function namespace (#202) * 2nd attempt to fix empty function namespace * added back test --- app/templates/manifest.xml | 8 ++++---- tests/test_router_manifest.py | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/templates/manifest.xml b/app/templates/manifest.xml index d6aa3a20..f0e57bb8 100644 --- a/app/templates/manifest.xml +++ b/app/templates/manifest.xml @@ -46,7 +46,7 @@ - {% if settings.functions_namespace %} + {% if settings.functions_namespace or settings.environment != 'prod' %} {% endif %} @@ -127,8 +127,8 @@ - {% if settings.functions_namespace %} - + {% if settings.functions_namespace or settings.environment != 'prod' %} + {% endif %} @@ -144,7 +144,7 @@ {% if "entraid" in settings.auth_providers %} {{ settings.auth_entraid_client_id }} - api://{{ base_url_with_app_path | replace("https://", "") }}/{{ settings.auth_entraid_client_id }} + api://{{ base_url_with_app_path|replace("https://", "") }}/{{ settings.auth_entraid_client_id }} openid profile diff --git a/tests/test_router_manifest.py b/tests/test_router_manifest.py index e63c025d..353ce26d 100644 --- a/tests/test_router_manifest.py +++ b/tests/test_router_manifest.py @@ -28,13 +28,19 @@ def test_get_manifest_prod(mocker): ) -def test_empty_function_namespace(mocker): +def test_empty_function_namespace_prod(mocker): mocker.patch.object(settings, "environment", "prod") mocker.patch.object(settings, "functions_namespace", "") response = client.get(f"{settings.app_path}/manifest") assert "Functions.Namespace" not in response.text +def test_empty_function_namespace_nonprod(mocker): + mocker.patch.object(settings, "functions_namespace", "") + response = client.get(f"{settings.app_path}/manifest") + assert '' in response.text + + def test_entraid_auth_deactivated(): response = client.get(f"{settings.app_path}/manifest") assert "" not in response.text