From b78d28bcfd9510d3f25dd5d3c96225714db3ffaa Mon Sep 17 00:00:00 2001 From: Ricardo Garcia Silva Date: Wed, 20 Dec 2023 16:07:28 +0000 Subject: [PATCH] Modified starlette test client initialization to not receive a base URL (#1447) --- tests/util.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/util.py b/tests/util.py index ab5f43d..24a4182 100644 --- a/tests/util.py +++ b/tests/util.py @@ -162,15 +162,14 @@ def mock_starlette(config_file: str = 'pygeoapi-test-config.yml', reload(starlette_app) # Get server root path - base_url = starlette_app.CONFIG['server']['url'].rstrip('/') - root_path = urlsplit(base_url).path.rstrip('/') or '' + public_base_url = starlette_app.CONFIG['server']['url'].rstrip('/') + root_path = urlsplit(public_base_url).path.rstrip('/') or '' # Create and return test client # Note: setting the 'root_path' does NOT really work and # does not have the same effect as Flask's APPLICATION_ROOT client = StarletteClient( starlette_app.APP, - base_url, root_path=root_path, **kwargs )