Skip to content

Commit

Permalink
Test GS issue #738
Browse files Browse the repository at this point in the history
  • Loading branch information
index-git committed Jan 10, 2023
1 parent 0286e58 commit 25e203a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Empty file.
29 changes: 29 additions & 0 deletions tests/dynamic_data/publications/issues/gs_sld_style_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import io
import xml.etree.ElementTree as ET
import pytest

from test_tools import process_client
from geoserver import util as gs_util
from layman import util as laymen_util, app, settings


@pytest.mark.usefixtures('ensure_layman_module')
def test_issue_738():
workspace = 'dynamic_test_workspace_layer_issue_738'
layer = 'layer_issue_738'

process_client.publish_workspace_layer(workspace=workspace,
name=layer,
style_file='sample/style/basic.sld',
)
with app.app_context():
layer_info = laymen_util.get_publication_info(workspace, process_client.LAYER_TYPE, layer, context={'keys': ['wms']})
geoserver_workspace = layer_info.get('_wms', {}).get('workspace')

response = gs_util.get_workspace_style_response(geoserver_workspace=geoserver_workspace,
stylename=layer,
headers=gs_util.headers_sld['1.1.0'],
auth=settings.LAYMAN_GS_AUTH,
)
style = ET.parse(io.BytesIO(response.content))
assert ET.tostring(style.getroot()) == b'''<ns0:StyledLayerDescriptor xmlns:ns0="http://www.opengis.net/sld">org.geotools.styling.StyledLayerDescriptorImpl@544d668e</ns0:StyledLayerDescriptor>'''

0 comments on commit 25e203a

Please sign in to comment.