-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test WFS GetCapabilities operation URLs
- Loading branch information
Showing
2 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 20 additions & 5 deletions
25
tests/dynamic_data/publications/x_forwarded_prefix/geoserver_endpoints_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,35 @@ | ||
import pytest | ||
from test_tools import geoserver_client | ||
|
||
PROXY_PREFIX = '/layman-proxy' | ||
headers = {'X-Forwarded-Prefix': PROXY_PREFIX, | ||
'X-Forwarded-Path': '/some-other-proxy', | ||
} | ||
|
||
|
||
@pytest.mark.parametrize('version', [ | ||
'1.3.0', | ||
'1.1.1' | ||
]) | ||
@pytest.mark.usefixtures('ensure_layman_module') | ||
def test_wms_get_capabilities(version): | ||
proxy_prefix = '/layman-proxy' | ||
headers = {'X-Forwarded-Prefix': proxy_prefix, | ||
'X-Forwarded-Path': '/some-other-proxy', | ||
} | ||
wms_inst = geoserver_client.get_wms_capabilities(workspace=None, | ||
version=version, | ||
headers=headers, | ||
) | ||
assert all(m.get('url').startswith(f'http://localhost:8000{proxy_prefix}/geoserver/') for operation in | ||
assert all(m.get('url').startswith(f'http://localhost:8000{PROXY_PREFIX}/geoserver/') for operation in | ||
['GetCapabilities', 'GetMap', 'GetFeatureInfo'] for m in wms_inst.getOperationByName(operation).methods) | ||
|
||
|
||
@pytest.mark.parametrize('version', [ | ||
'2.0.0', | ||
'1.1.0' | ||
]) | ||
@pytest.mark.usefixtures('ensure_layman_module') | ||
def test_wfs_get_capabilities(version): | ||
wfs_inst = geoserver_client.get_wfs_capabilities(workspace=None, | ||
version=version, | ||
headers=headers, | ||
) | ||
assert all(m.get('url').startswith(f'http://localhost:8000{PROXY_PREFIX}/geoserver/') for operation in | ||
['GetCapabilities', 'DescribeFeatureType', 'GetFeature'] for m in wfs_inst.getOperationByName(operation).methods) |