diff --git a/acceptance_tests/tests/test_cascaded_stores.py b/acceptance_tests/tests/test_cascaded_stores.py index a5061c78e..e355e3978 100644 --- a/acceptance_tests/tests/test_cascaded_stores.py +++ b/acceptance_tests/tests/test_cascaded_stores.py @@ -31,25 +31,13 @@ def create_cascaded_wms_store_payload(): } -def delete_wms_store(geoserver): - geoserver.delete_request( - f"/rest/workspaces/{WORKSPACE}/wmsstores/{WMS_STORE}?recurse=true" - ) - - -def delete_wmts_store(geoserver): - geoserver.delete_request( - f"/rest/workspaces/{WORKSPACE}/wmtsstores/{WMTS_STORE}?recurse=true" - ) - - @pytest.fixture(scope="module") def geoserver(): geoserver = GeoServerCloud(url=GEOSERVER_URL) geoserver.create_workspace(WORKSPACE, set_default_workspace=True) geoserver.publish_workspace(WORKSPACE) yield geoserver - # geoserver.delete_workspace(WORKSPACE) + geoserver.delete_workspace(WORKSPACE) def test_cascaded_wms(geoserver): @@ -98,7 +86,11 @@ def test_cascaded_wms(geoserver): data = json.loads(response.read().decode("utf-8")) assert data.get("features") == [] - delete_wms_store(geoserver) + # Delete store + response = geoserver.delete_request( + f"/rest/workspaces/{WORKSPACE}/wmsstores/{WMS_STORE}?recurse=true" + ) + assert response.status_code == 200 def test_cascaded_wmts(geoserver): @@ -135,6 +127,10 @@ def test_cascaded_wmts(geoserver): ) assert response.info().get("Content-Type") == format + # Delete layer and store response = geoserver.delete_request(f"/gwc/rest/layers/{WORKSPACE}:{WMTS_LAYER}") assert response.status_code == 200 - delete_wmts_store(geoserver) + response = geoserver.delete_request( + f"/rest/workspaces/{WORKSPACE}/wmtsstores/{WMTS_STORE}?recurse=true" + ) + assert response.status_code == 200 diff --git a/acceptance_tests/tests/test_gwc.py b/acceptance_tests/tests/test_gwc.py index d5af14f84..cfda180d5 100644 --- a/acceptance_tests/tests/test_gwc.py +++ b/acceptance_tests/tests/test_gwc.py @@ -17,9 +17,9 @@ def geoserver_with_gwc_layers(geoserver): geoserver.get_request( f"/rest/workspaces/{WORKSPACE}/wmtsstores/{WMTS_STORE}/layers/{WMTS_LAYER}.json" ) - response = geoserver.publish_gwc_layer(WORKSPACE, WMTS_LAYER) - assert response.status_code == 200 + geoserver.publish_gwc_layer(WORKSPACE, WMTS_LAYER) yield geoserver + geoserver.delete_request(f"/gwc/rest/layers/{WORKSPACE}:{WMTS_LAYER}") geoserver.delete_workspace(WORKSPACE)