Skip to content

Commit

Permalink
Merge pull request #276 from KNMI/fix-plus-in-file
Browse files Browse the repository at this point in the history
Fix plus in file
  • Loading branch information
maartenplieger committed Aug 21, 2023
2 parents 8e0ee4c + b806cb1 commit efb40c9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
Binary file added data/datasets/testdata+001.nc
Binary file not shown.
4 changes: 3 additions & 1 deletion python/python_fastapi_server/routers/wmswcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ async def handle_wms(req: Request, ):
if len(param_parts) == 2 and param_parts[0].upper() == "DATASET":
query_string += f"&{param_parts[0]}={param_parts[1]}"
else:
query_string += f"&{k}={req.query_params[k]}"
query_param=req.query_params[k]
query_param = query_param.replace('+', '%2B')
query_string += f"&{k}={query_param}"

# Run adaguc-server
status, data, headers = adaguc_instance.runADAGUCServer(query_string,
Expand Down
16 changes: 16 additions & 0 deletions tests/AdagucTests/TestWMS.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ def test_WMSGetMap_testdatanc(self):
data.getvalue(),
AdagucTestTools().readfromfile(self.expectedoutputsspath +
filename))
def test_WMSGetMap_testdatanc_withplus(self):
AdagucTestTools().cleanTempDir()
filename = "test_WMSGetMap_testdatanc_plus.png"
# pylint: disable=unused-variable
status, data, headers = AdagucTestTools().runADAGUCServer(
"source=testdata%2B001.nc&SERVICE=WMS&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=testdata&WIDTH=256&HEIGHT=256&CRS=EPSG%3A4326&BBOX=30,-30,75,30&STYLES=testdata%2Fnearest&FORMAT=image/png&TRANSPARENT=FALSE&",
env=self.env,
args=["--report"])
AdagucTestTools().writetofile(self.testresultspath + filename,
data.getvalue())
self.assertEqual(status, 0)
self.assertEqual(
data.getvalue(),
AdagucTestTools().readfromfile(self.expectedoutputsspath +
filename))


def test_WMSGetMap_geos(self):
AdagucTestTools().cleanTempDir()
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit efb40c9

Please sign in to comment.