Skip to content

Commit

Permalink
Modified starlette test client initialization to not receive a base URL
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogsilva committed Dec 20, 2023
1 parent 07b40a4 commit 0f047e8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 0f047e8

Please sign in to comment.