From a785d1c2de7d227674051b865935013bdd27e60f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 4 Jul 2022 09:58:56 +0200 Subject: Adding upstream version 1.12.0. Signed-off-by: Daniel Baumann --- tests/unittests/command_parse/test_geo.py | 36 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'tests/unittests/command_parse/test_geo.py') diff --git a/tests/unittests/command_parse/test_geo.py b/tests/unittests/command_parse/test_geo.py index 8a8d4c7..8502696 100644 --- a/tests/unittests/command_parse/test_geo.py +++ b/tests/unittests/command_parse/test_geo.py @@ -9,31 +9,37 @@ def test_geoadd(judge_command): "member": '"Catania"', }, ) + judge_command( + 'GEOADD Sicily NX CH 13.361389 38.115556 "Palermo" 15.087269 37.502669 "Catania"', + { + "command": "GEOADD", + "condition": "NX", + "changed": "CH", + "key": "Sicily", + "longitude": "15.087269", + "latitude": "37.502669", + "member": '"Catania"', + }, + ) -def test_georadiusbymember(judge_command): +def test_geosearch(judge_command): judge_command( - "GEORADIUSBYMEMBER Sicily Agrigento 100 km", + "GEOSEARCH Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC WITHCOORD WITHDIST", { - "command": "GEORADIUSBYMEMBER", + "command": "GEOSEARCH", "key": "Sicily", - "member": "Agrigento", - "float": "100", - "distunit": "km", + "any": "FROMLONLAT 15 37 BYBOX 400 400 km ASC WITHCOORD WITHDIST", }, ) -def test_georadius(judge_command): +def test_geosearchstore(judge_command): judge_command( - "GEORADIUS Sicily 15 37 200 km WITHDIST WITHCOORD ", + "GEOSEARCHSTORE key2 Sicily FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3 STOREDIST", { - "command": "GEORADIUS", - "key": "Sicily", - "longitude": "15", - "latitude": "37", - "float": "200", - "distunit": "km", - "geochoice": "WITHCOORD", + "command": "GEOSEARCHSTORE", + "key": ["Sicily", "key2"], + "any": "FROMLONLAT 15 37 BYBOX 400 400 km ASC COUNT 3 STOREDIST", }, ) -- cgit v1.2.3