Skip to content

Commit

Permalink
added small test for logical operators in extent_query
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstnbwnkl authored and Gustry committed Jan 30, 2024
1 parent 08db51e commit 06f9db8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions QuickOSM/test/test_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,35 @@ def test_build_in_extent_query(self):

self.assertEqual(result_expected, result)

def test_build_in_extent_query_with_multitypes(self):
"""Test for the build of an in extent algorithm that uses the multitypes parameter."""
result = processing.run(
'quickosm:buildqueryextent',
{
'EXTENT': '8.71679,8.79689,51.70687,51.72602 [EPSG:4326]',
'KEY': 'highway,footway',
'SERVER': 'https://lz4.overpass-api.de/api/interpreter',
'TIMEOUT': 25,
'TYPE_MULTI_REQUEST': 'AND',
'VALUE': 'footway,sidewalk'
}
)
result_expected = {
'OUTPUT_OQL_QUERY':
'[out:xml] [timeout:25];\n(\n node["highway"="footway"]["footway"="sidewalk"]'
'( 51.70687,8.71679,51.72602,8.79689);\n way["highway"="footway"]["footway"="sidewalk"]'
'( 51.70687,8.71679,51.72602,8.79689);\n relation["highway"="footway"]'
'["footway"="sidewalk"]( 51.70687,8.71679,51.72602,8.79689);\n);\n(._;>;);\nout body;',
'OUTPUT_URL':
'https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:25];%0A(%0A'
' node[%22highway%22%3D%22footway%22][%22footway%22%3D%22sidewalk%22]'
'( 51.70687,8.71679,51.72602,8.79689);%0A way[%22highway%22%3D%22footway%22]'
'[%22footway%22%3D%22sidewalk%22]( 51.70687,8.71679,51.72602,8.79689);%0A '
'relation[%22highway%22%3D%22footway%22][%22footway%22%3D%22sidewalk%22]'
'( 51.70687,8.71679,51.72602,8.79689);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin'
}
self.assertEqual(result_expected, result)

def test_build_raw_query(self):
"""Test for the build of a raw query algorithm."""
result = processing.run(
Expand Down

0 comments on commit 06f9db8

Please sign in to comment.