diff --git a/QuickOSM/test/test_processing_network.py b/QuickOSM/test/test_processing_network.py index 7917c627..d3266c15 100644 --- a/QuickOSM/test/test_processing_network.py +++ b/QuickOSM/test/test_processing_network.py @@ -48,11 +48,8 @@ def test_process_raw_query(self): """Test for the process algorithm from a raw query.""" handler = SequentialHandler() handler.add( - 'GET', - "/interpreter?data=[out:xml]%20[timeout:25];%0A%20area(3600028722)%20-%3E%20.area_0;" - "%0A(%0A%20%20%20%20node[%22amenity%22%3D%22bench%22](area.area_0);%0A%20%20%20%20way" - "[%22amenity%22%3D%22bench%22](area.area_0);%0A%20%20%20%20relation[%22amenity%22%3D%22bench%22]" - "(area.area_0);%0A);%0A(._;%3E;);%0Aout%20body;&info=QgisQuickOSMPlugin", + 'POST', + "/interpreter?info=QgisQuickOSMPlugin", 200, {'Content-type': 'text/xml'}, open(plugin_test_data_path('overpass', 'empty_osm_file.xml'), 'r', encoding='utf8').read(), @@ -68,7 +65,7 @@ def test_process_raw_query(self): 'relation[\"amenity\"=\"bench\"](area.area_0);\n);\n' '(._;>;);\nout body;', 'TIMEOUT': 25, - 'SERVER': 'http://localhost:{}/interpreter'.format(self.port), + 'SERVER': f'http://localhost:{self.port}/interpreter', 'EXTENT': '3.809971100,3.963647400,43.557942300,43.654612100 [EPSG:4326]', 'AREA': '', 'FILE': '' @@ -84,7 +81,7 @@ def test_process_not_spatial_query(self): """Test for the process algorithm from a not spatial query.""" handler = SequentialHandler() handler.add( - 'GET', + 'POST', '/interpreter?data=[out:xml]%20[timeout:25];%0A(%0A%20%20%20%20node[%22amenity%22%3D%22foo%22];' '%0A%20%20%20%20way[%22amenity%22%3D%22foo%22];%0A%20%20%20%20relation[%22amenity%22%3D%22foo%22]' ';%0A);%0A(._;%3E;);%0Aout%20body;&info=QgisQuickOSMPlugin', @@ -112,7 +109,7 @@ def test_process_in_query(self): """Test for the process algorithm from an 'in' query.""" handler = SequentialHandler() handler.add( - 'GET', + 'POST', '/interpreter?data=[out:xml]%20[timeout:25];%0A%20area(3600118810)%20-%3E%20.area_0;%0A' '(%0A%20%20%20%20node[%22amenity%22%3D%22bench%22](area.area_0);%0A%20%20%20%20way[%22amenity' '%22%3D%22bench%22](area.area_0);%0A%20%20%20%20relation[%22amenity%22%3D%22bench%22]' @@ -142,7 +139,7 @@ def test_process_around_query(self): """Test for the process algorithm from an 'around' query.""" handler = SequentialHandler() handler.add( - 'GET', + 'POST', '/interpreter?data=[out:xml]%20[timeout:25];%0A(%0A%20%20%20%20node[%22amenity%22%3D%22bench%22]' '(around:1500,%2046.2383347,1.4861387);%0A%20%20%20%20way[%22amenity%22%3D%22bench%22]' '(around:1500,%2046.2383347,1.4861387);%0A%20%20%20%20relation[%22amenity%22%3D%22bench%22]' @@ -158,7 +155,7 @@ def test_process_around_query(self): 'AREA': 'La Souterraine', 'DISTANCE': 1500, 'KEY': 'amenity', - 'SERVER': 'http://localhost:{}/interpreter'.format(self.port), + 'SERVER': f'http://localhost:{self.port}/interpreter', 'TIMEOUT': 25, 'VALUE': 'bench' } @@ -173,7 +170,7 @@ def test_process_extent_query(self): """Test for the process algorithm from an 'extent' query.""" handler = SequentialHandler() handler.add( - 'GET', + 'POST', '/interpreter?data=[out:xml]%20[timeout:25];%0A(%0A%20%20%20%20node[%22amenity%22%3D%22bench%22]' '(%2043.55794,3.80997,43.65461,3.96364);%0A%20%20%20%20way[%22amenity%22%3D%22bench%22]' '(%2043.55794,3.80997,43.65461,3.96364);%0A%20%20%20%20relation[%22amenity%22%3D%22bench%22]' @@ -188,7 +185,7 @@ def test_process_extent_query(self): { 'EXTENT': '3.809971100,3.963647400,43.557942300,43.654612100 [EPSG:4326]', 'KEY': 'amenity', - 'SERVER': 'http://localhost:{}/interpreter'.format(self.port), + 'SERVER': f'http://localhost:{self.port}/interpreter', 'TIMEOUT': 25, 'VALUE': 'bench' } @@ -201,11 +198,11 @@ def test_process_extent_query(self): def test_reprojection_extent_query(self): """Test for the reprojection from the project CRS.""" - # In processing.run, we can see some 2154 coordinates. - # In the query, coordinates in 4326 + # In processing.run, we can see some EPSG:2154 coordinates. + # In the query, coordinates are in EPSG:4326 handler = SequentialHandler() handler.add( - 'GET', + 'POST', '/interpreter?data=[out:xml]%20[timeout:25];%0A(%0A%20%20%20%20node[%22landuse%22]' '(%2045.0843,-0.3832,45.09649,-0.36385);%0A%20%20%20%20way[%22landuse%22]' '(%2045.0843,-0.3832,45.09649,-0.36385);%0A%20%20%20%20relation[%22landuse%22]' @@ -227,7 +224,7 @@ def test_reprojection_extent_query(self): 'VALUE': '', 'EXTENT': '433888.4776000,435466.5863000,6448484.3786000,6449771.2615000 [EPSG:2154]', 'TIMEOUT': 25, - 'SERVER': 'http://localhost:{}/interpreter'.format(self.port), + 'SERVER': f'http://localhost:{self.port}/interpreter', }, context=context )