Skip to content

Commit

Permalink
Test also WFS-T Delete in test_wfs_bbox
Browse files Browse the repository at this point in the history
  • Loading branch information
jirik committed May 3, 2021
1 parent 256736e commit 006be67
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/layman/geoserver_proxy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,16 @@ def test_wfs_bbox():

assert_all_sources_bbox(workspace, layer, expected_bbox)

data_xml = data_wfs.get_wfs20_delete_point(workspace, layer, )

r = requests.post(rest_url,
data=data_xml,
headers=headers)
assert r.status_code == 200, r.text

# until there is way to check end of asynchronous task after WFS-T
time.sleep(5)

assert_all_sources_bbox(workspace, layer, SMALL_LAYER_BBOX)

client_util.delete_workspace_layer(workspace, layer, )
25 changes: 25 additions & 0 deletions test/data/wfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,31 @@ def get_wfs20_insert_points(workspace, layername):
</wfs:Transaction>'''


def get_wfs20_delete_point(workspace, layername):
return f'''<?xml version="1.0"?>
<wfs:Transaction
version="2.0.0"
service="WFS"
xmlns:{workspace}="http://{workspace}"
xmlns:fes="http://www.opengis.net/fes/2.0"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:wfs="http://www.opengis.net/wfs/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs/2.0
http://schemas.opengis.net/wfs/2.0/wfs.xsd
http://www.opengis.net/gml/3.2
http://schemas.opengis.net/gml/3.2.1/gml.xsd">
<wfs:Delete typeName="{workspace}:{layername}">
<fes:Intersects>
<fes:ValueReference>{workspace}:wkb_geometry</fes:ValueReference>
<gml:Point srsName="urn:ogc:def:crs:EPSG::3857" srsDimension="2">
<gml:pos>1571000 6268800</gml:pos>
</gml:Point>
</fes:Intersects>
</wfs:Delete>
</wfs:Transaction>'''


def get_wfs20_insert_lines(workspace, layername):
return f'''<?xml version="1.0"?>
<wfs:Transaction
Expand Down

0 comments on commit 006be67

Please sign in to comment.