From 6a6a00564505a357119e319805ec6daa49fdcc2f Mon Sep 17 00:00:00 2001 From: mazano Date: Sat, 21 Oct 2023 09:09:25 +0200 Subject: [PATCH] fix test --- scenario_tests/stores/docker-compose-gdal.yml | 1 - scenario_tests/stores/tests/test_gdal.py | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scenario_tests/stores/docker-compose-gdal.yml b/scenario_tests/stores/docker-compose-gdal.yml index 54aca012..5b9d2e4e 100644 --- a/scenario_tests/stores/docker-compose-gdal.yml +++ b/scenario_tests/stores/docker-compose-gdal.yml @@ -15,7 +15,6 @@ services: environment: GEOSERVER_ADMIN_PASSWORD: myawesomegeoserver GEOSERVER_ADMIN_USER: admin - SAMPLE_DATA: TRUE TEST_CLASS: test_gdal.TestGeoServerGDAL ports: - "8080" diff --git a/scenario_tests/stores/tests/test_gdal.py b/scenario_tests/stores/tests/test_gdal.py index 352674e7..231d7162 100644 --- a/scenario_tests/stores/tests/test_gdal.py +++ b/scenario_tests/stores/tests/test_gdal.py @@ -55,9 +55,11 @@ def test_publish_gdal_store(self): curl_command = f'curl -u {self.geo_username}:{self.geo_password} -v -XPUT -H "Content-type: text/plain" -d "file:{vrt_path}" {vrt_upload_url}' check_call(curl_command, shell=True) - # Check that the data store exists - data_store_url = f'{self.gs_url}/rest/workspaces/{self.geo_workspace_name}/datastores/{self.store_name}.json' - response = get(data_store_url, auth=auth) + # Check that the published layer exists + layer_source_url = f'{self.gs_url}/{self.geo_workspace_name}/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image/jpeg&TRANSPARENT=true&STYLES&LAYERS={self.geo_workspace_name}:{self.store_name}&exceptions=application/vnd.ogc.se_inimage&SRS=EPSG:26713&WIDTH=768&HEIGHT=578&BBOX=594739.7048312925,4919224.415741393,602069.4450795503,4924731.264860202' + response = get(layer_source_url) + + # Check that the response has a status code of 200 (OK) self.assertEqual(response.status_code, 200)